Ask a Question related to Ruby, Design and Development.
-
Francis Hwang #1
Lafcadio: An object-relational mapping layer for Ruby
Hi everybody,
I've just released Lafcadio, an object-relational mapping layer for
Ruby and MySQL, as an alpha release. So far this code hasn't been used
by anybody else, but it's currently in use on three live sites --
including one pretty high-traffic site -- not to mention that I've
used it over the past year on a number of personal projects.
Again, it's in alpha, so I don't expect anybody to put their payroll
system on it right now. But if there's anybody out there who's
interested in this sort of thing, and would like to help me out with
it -- either just testing it or coding or just telling me where my
docs could be clearer -- I'd appreciate your input.
[url]http://lafcadio.sourceforge.net[/url]
Francis
Francis Hwang Guest
-
Object Layer Comp Options
Can I turn on and off picture layers if the photo has not had layers applied or built in Photoshop? -
Object Relational, Foreign Keys and Triggers
I am facing the classic pgsql ORDBMS problem: create sequence entity_id_seq; create table entity ( entity_id int not null default... -
Mapping artwork to a 3D object!!!
When mapping artwork to a 3D object like type with a couple of outlined strokes and you click ok, When viewing it the strokes don't line up with the... -
Move and resize object in layer
I have a round ball on a layer by itself and I want to make the ball smaller and then move it in relation to an object in another layer. I must be... -
Guidelines for using Oracle 9i Object Relational Features
"S.T.Arun" wrote: I would stay as far away from OO in the database as you can. OO databases, as can be clearly seen by their... -
Francis Hwang #2
Re: Lafcadio: An object-relational mapping layer for Ruby
Database independence, to my mind, is a useful goal but not the main
point of an object-relational mapping layer. For me, the main point is
reducing the need to keep small database-details in mind, and treat
domain entities like they're first-class Ruby objects, with as little
thinking about the underlying DB as possible.
Example 1: You have a Invoice class (or table) with an invoiceDate
field. Lafcadio code to manipulate this date might look like:
myInvoice = objectStore.getInvoice invoiceNum
myInvoice = Date.today
objectStore.commit myInvoice
.... so you don't have to think about SQL date formatting. Similarly,
string fields don't have to be quote-escaped for commits.
Example 2: Your Invoice table has two boolean fields: "shipped" stores
values in MySQL as 0 and 1, while "viewed" stores values as "Y" and
"N". This is far from ideal, of course, but unfortunately I've seen
far worse code in my career. And let's say you can't change these
fields easily because they're accessed in an indeterminate number of
PHP scripts. (Also common, unfortunately.) Committing straight through
DBI would require you to always remember which field uses which
enumeration, but by setting your field definitions in Lafcadio code
you'd never have to think about it again. You could simply set them to
be true or false:
myInvoice.viewed = true
myInvoice.shipped = false
objectStore.commit myInvoice
.... and when the objectStore does the committing it will figure out
what values to enter into what fields.
Francis
Brian McCallister <mccallister@forthillcompany.com> wrote in message news:<8B2BF50C-C5CE-11D7-86DC-000A95782782@forthillcompany.com>...> I have noticed this, and Vapor (for PostgreSQL) being advertised. Is
> there difficulty in building against the DBI module to allow some
> degree of database independence?
>
> -Brian
>
> On Sunday, August 3, 2003, at 08:45 AM, Francis Hwang wrote:
>> > Hi everybody,
> >
> > I've just released Lafcadio, an object-relational mapping layer for
> > Ruby and MySQL, as an alpha release. So far this code hasn't been used
> > by anybody else, but it's currently in use on three live sites --
> > including one pretty high-traffic site -- not to mention that I've
> > used it over the past year on a number of personal projects.
> >
> > Again, it's in alpha, so I don't expect anybody to put their payroll
> > system on it right now. But if there's anybody out there who's
> > interested in this sort of thing, and would like to help me out with
> > it -- either just testing it or coding or just telling me where my
> > docs could be clearer -- I'd appreciate your input.
> >
> > [url]http://lafcadio.sourceforge.net[/url]
> >
> > Francis
> >Francis Hwang Guest
-
Francis Hwang #3
Re: Lafcadio: An object-relational mapping layer for Ruby
Andreas:
If this is to become reusable across a number of different DBs (like
PostgresSQL) then I suppose that's a necessary step. That step should
be fairly easy, since the database calls are limited to just a few
methods.
The main difficulty in such an adaptation would be differences in SQL;
without having used PostgresSQL a lot I'd imagine there would be a few
key differences that would require adaptation.
Or is there another reason you're bringing up DBI?
Francis
Andreas Schwarz <usenet@andreas-s.net> wrote in message news:<slrnbirak2.bim.usenet@home.andreas-s.net>...> Francis Hwang wrote:>> > I've just released Lafcadio, an object-relational mapping layer for
> > Ruby and MySQL, as an alpha release. So far this code hasn't been used
> > by anybody else, but it's currently in use on three live sites --
> > including one pretty high-traffic site -- not to mention that I've
> > used it over the past year on a number of personal projects.
> This looks interesting, but IMO it would be far more useful if you would
> use DBI instead of direct mysql access.
>
> AndreasFrancis Hwang Guest
-
Dmitry V. Sabanin #4
Re: Lafcadio: An object-relational mapping layer for Ruby
Hi!
ATM i'm making project that will help one to quickly have site with news
system, forum, guestbook, etc. May i include your code into the package?
I want to use it widely through all of my code. It will be released as LGPL.
P.S. I'm now trying to make test-suites run without errors on 1.8, it have a
lot of "meth (bla)" code, that sometimes raises syntax errors.
--
sdmitry -=- Dmitry V. Sabanin
MuraveyLabs.
Dmitry V. Sabanin Guest
-
Francis Hwang #5
Re: Lafcadio: An object-relational mapping layer for Ruby
"Dmitry V. Sabanin" <sdmitry@lrn.ru> wrote in message news:<200308041940.23854.sdmitry@lrn.ru>...
Perhaps things would be clearer for people using your package if you> Hi!
>
> ATM i'm making project that will help one to quickly have site with news
> system, forum, guestbook, etc. May i include your code into the package?
> I want to use it widely through all of my code. It will be released as LGPL.
simply listed Lafcadio as a requirement, and pointed them to where it
can be downloaded. Being in alpha, Lafcadio might be a bit of a moving
target in the short term, so it might be a bit of a hassle for you to
constantly incorporate new changes.
Oop! Been doing a lot more testing in 1.6.8 than in 1.8. I'll get on>
> P.S. I'm now trying to make test-suites run without errors on 1.8, it have a
> lot of "meth (bla)" code, that sometimes raises syntax errors.
that right away, thanks.
Francis
Francis Hwang Guest
-
Dmitry V. Sabanin #6
Re: Lafcadio: An object-relational mapping layer for Ruby
On Tuesday 05 August 2003 10:18, Francis Hwang wrote:
I placed it in the redist directory, and probably, i'll write it in my INSTALL> "Dmitry V. Sabanin" <sdmitry@lrn.ru> wrote in message
> news:<200308041940.23854.sdmitry@lrn.ru>...
>>> > Hi!
> >
> > ATM i'm making project that will help one to quickly have site with news
> > system, forum, guestbook, etc. May i include your code into the package?
> > I want to use it widely through all of my code. It will be released as
> > LGPL.
> Perhaps things would be clearer for people using your package if you
> simply listed Lafcadio as a requirement, and pointed them to where it
> can be downloaded. Being in alpha, Lafcadio might be a bit of a moving
> target in the short term, so it might be a bit of a hassle for you to
> constantly incorporate new changes.
file, that user will be able to use another version of lafcadio. I just want
to have as little dependencies, as it is possible, to make everything working
out of box. But maybe i'm wrong, i have to think about this some time.
No problems, if you want i could mail you (or give you data for accessing CVS)>> > P.S. I'm now trying to make test-suites run without errors on 1.8, it
> > have a lot of "meth (bla)" code, that sometimes raises syntax errors.
> Oop! Been doing a lot more testing in 1.6.8 than in 1.8. I'll get on
> that right away, thanks.
that have a lots of code fixed already.
Btw, big thank you for a good library! :)
--> Francis
sdmitry -=- Dmitry V. Sabanin
MuraveyLabs.
Dmitry V. Sabanin Guest
-
Francis Hwang #7
Re: Lafcadio: An object-relational mapping layer for Ruby
"Dmitry V. Sabanin" <sdmitry@lrn.ru> wrote in message news:<200308052158.01542.sdmitry@lrn.ru>...
That might work, too. Feel free to try out whatever you think will> On Tuesday 05 August 2003 10:18, Francis Hwang wrote:>> > Perhaps things would be clearer for people using your package if you
> > simply listed Lafcadio as a requirement, and pointed them to where it
> > can be downloaded. Being in alpha, Lafcadio might be a bit of a moving
> > target in the short term, so it might be a bit of a hassle for you to
> > constantly incorporate new changes.
> I placed it in the redist directory, and probably, i'll write it in my INSTALL
> file, that user will be able to use another version of lafcadio. I just want
> to have as little dependencies, as it is possible, to make everything working
> out of box. But maybe i'm wrong, i have to think about this some time.
work for your project. BTW, Lafcadio is LGPL, too.
I went ahead and fixed all the syntax errors (mostly adding a lot of>> >> > > P.S. I'm now trying to make test-suites run without errors on 1.8, it
> > > have a lot of "meth (bla)" code, that sometimes raises syntax errors.
> > Oop! Been doing a lot more testing in 1.6.8 than in 1.8. I'll get on
> > that right away, thanks.
> No problems, if you want i could mail you (or give you data for accessing CVS)
> that have a lots of code fixed already.
parenthesis) and all the tests run fine as of the last CVS checkin,
but you have to suppress warnings or else the output's pretty messy.
I'm planning on fixing all the warnings in the next day or so.
If you want to email me code that fixes warnings, that'd be great.
Otherwise I can just handle it on my own, too.
You're welcome!> Btw, big thank you for a good library! :)
Francis Hwang Guest
-
Francis Hwang #8
Re: Lafcadio: An object-relational mapping layer for Ruby
Today's release (0.1.2) runs fine in Ruby 1.8.0 without any warnings.
Francis
Francis Hwang Guest
-
Francis Hwang #9
Re: Lafcadio: An object-relational mapping layer for Ruby
"Dmitry V. Sabanin" <sdmitry@lrn.ru> wrote in message news:<200308072315.45074.sdmitry@lrn.ru>...
At this moment I'm not making a lot of drastic changes, so you can> On Thursday 07 August 2003 23:05, Francis Hwang wrote:> Thanx, sorry for being idle for a while..> > Today's release (0.1.2) runs fine in Ruby 1.8.0 without any warnings.
> Question, do you make changes to CVS often? Or i can just get the tar-ball?> > Francis
probably just get the tar-ball.
Francis Hwang Guest



Reply With Quote

