[Dbix-class] Newbie question

Andreas Mock andreas.mock at drumedar.de
Mon Mar 16 10:55:45 GMT 2009


> -----Ursprüngliche Nachricht-----
> Von: "Jess Robinson" <castaway at desert-island.me.uk>
> Gesendet: 16.03.09 11:13:14
> An: "DBIx::Class user and developer list" <dbix-class at lists.scsys.co.uk>
> Betreff: Re: [Dbix-class] Newbie question

Hi Jess,

thank you for answering.

>
> Business object? Care to explain what you mean by that? Examples?

Probably I was just struggling because the docs often talk of rows, tables, columns
which are elements of a database domain and not an object domain.

>
> > Which class or instance of it creates the business objects when getting it from database?
> > Is this part of DBIC or does DBIX just ends there?
> > Or (what is likely) do I just miss something?
>
> Taking a wild guess:
>
> $schema->resultset('Books');
>
> returns rows with attributes defined in the Result class Book.pm

Ha, there it is again...rows... ;-)

Are these rows "Book"-Objects???
Or do I have to use these row-objects with Book-attributes to initialize/instanciate
a Book-Object. (an object with other methods besides methods usfull for persistence)
Or is this by convention the same?


>
> Any call based directly on Books will return Book objects

What does that mean?
Does that imply that "rows" returned by ResultSets are NOT objects of a certain type?

>
> Is that what you meant?

Probably the first iteration for enhancing my understanding... ;-)

Best regards
Andreas



More information about the DBIx-Class mailing list