From: Victor P. <po...@na...> - 2008-02-10 16:44:35
|
I need OO<->MySQL mapper which supports class hierarchies (derived classes, inherited classes). That is I want the retrieved object automatically to become of some of derived classes (the class with which I have stored it) when I retrieve an abstract base class object. The Web page http://poop.sourceforge.net/ is lacking to point for every object store module whether it supports inheritance. Please add to the list which mappers support inheritance. |
From: Dave R. <au...@ur...> - 2008-02-10 17:09:24
|
On Sun, 10 Feb 2008, Victor Porton wrote: > I need OO<->MySQL mapper which supports class hierarchies (derived > classes, inherited classes). That is I want the retrieved object > automatically to become of some of derived classes (the class with which > I have stored it) when I retrieve an abstract base class object. > > The Web page http://poop.sourceforge.net/ is lacking to point for every > object store module whether it supports inheritance. That's a bit old these days. I _suspect_ you want something like Tangram. -dave /*=================================================== VegGuide.Org www.BookIRead.com Your guide to all that's veg. My book blog ===================================================*/ |
From: Victor P. <po...@na...> - 2008-02-11 12:23:43
|
I will look into Tangram. What else Perl OO<->RDBMS support inheritance/polymorphism? 10.02.08, 20:07, "Dave Rolsky" <au...@ur...>: > On Sun, 10 Feb 2008, Victor Porton wrote: > > I need OO<->MySQL mapper which supports class hierarchies (derived > > classes, inherited classes). That is I want the retrieved object > > automatically to become of some of derived classes (the class with which > > I have stored it) when I retrieve an abstract base class object. > > > > The Web page http://poop.sourceforge.net/ is lacking to point for every > > object store module whether it supports inheritance. > That's a bit old these days. I _suspect_ you want something like Tangram. |
From: David M. S. <poo...@tr...> - 2008-02-11 17:20:35
|
OOPS isn't a traditional OO/RDMS mapper but it's perfectly happy with inheritance/polymorphism. It does not have query support yet and supporting inheritance in hand-made queries is hard. Depending on your application, you may not care. -Dave On Feb 11, 2008 4:23 AM, Victor Porton <po...@na...> wrote: > I will look into Tangram. > > > > What else Perl OO<->RDBMS support inheritance/polymorphism? > > > > 10.02.08, 20:07, "Dave Rolsky" <au...@ur...>: > > > > > On Sun, 10 Feb 2008, Victor Porton wrote: > > > > I need OO<->MySQL mapper which supports class hierarchies (derived > > > > classes, inherited classes). That is I want the retrieved object > > > > automatically to become of some of derived classes (the class with which > > > > I have stored it) when I retrieve an abstract base class object. > > > > > > > > The Web page http://poop.sourceforge.net/ is lacking to point for every > > > > object store module whether it supports inheritance. > > > That's a bit old these days. I _suspect_ you want something like Tangram. > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Poop-group mailing list > Poo...@li... > https://lists.sourceforge.net/lists/listinfo/poop-group > > |
From: Mark H. <he...@sc...> - 2008-02-11 21:55:30
|
On Mon, 11 Feb 2008, Victor Porton wrote: > I will look into Tangram. > > What else Perl OO<->RDBMS support inheritance/polymorphism? Don't get too wrapped up in redefining the language itself -- Is this not a more basic question of object definition that can be applied to most ORM systems that use schema classes? I think in DBIx::Class, a schema object definition could do: package MyApp::Fork; sub spear { # ... } package MyApp::Spoon; sub scoop { # ... } package MyApp::Schema::Spork; use base qw( DBIx::Class MyApp::Fork MyApp::Spoon ); # ... $spork->can('scoop') && $spork->can('spear') # ... 0 < scalar map $spork->isa("MyApp::$_"), qw( Fork Spoon ); ### # or the inverse relationship: package MyApp::Silverware; use base qw( MyApp::Kitchen::Utensils ); # etc. etc. sub sort_pieces { # a class method sort algorithm, i.e. spoons > forks > knives } sub sound { # play resonance sound based on subclass } sub bend { # only for psychics and charletans } package MyApp::Schema::Spoon; use base qw( DBIx::Class MyApp::Silverware ); package MyApp::Schema::Fork; use base qw( DBIx::Class MyApp::Silverware ); package MyApp::Schema::Knife; use base qw( DBIx::Class MyApp::Silverware ); # ... Then you can arrange your files and their base classes in a more or less direct mapping to the cognitive entities of your system. Mark > 10.02.08, 20:07, "Dave Rolsky" <au...@ur...>: > > > On Sun, 10 Feb 2008, Victor Porton wrote: > > > I need OO<->MySQL mapper which supports class hierarchies (derived > > > classes, inherited classes). That is I want the retrieved object > > > automatically to become of some of derived classes (the class with which > > > I have stored it) when I retrieve an abstract base class object. > > > > > > The Web page http://poop.sourceforge.net/ is lacking to point for every > > > object store module whether it supports inheritance. > > > That's a bit old these days. I _suspect_ you want something like Tangram. > |
From: Mark H. <he...@sc...> - 2008-02-11 22:09:47
|
And here is some better info... http://lists.scsys.co.uk/pipermail/dbix-class/2007-January/003293.html BTW I forgot to say, I think in the parent classes you can write class methods to select groups of entities with "prefetch" joins and then bless them into your subclasses based on type, too, if you prefer to do it that way. As for saving a group of related items in bulk, that sounds complicated, probably easiest to sort them out and do them one class at a time. Mark On Mon, 11 Feb 2008, Mark Hedges wrote: > > On Mon, 11 Feb 2008, Victor Porton wrote: > > I will look into Tangram. > > > > What else Perl OO<->RDBMS support inheritance/polymorphism? > > Don't get too wrapped up in redefining the language itself -- > Is this not a more basic question of object definition that > can be applied to most ORM systems that use schema classes? > > I think in DBIx::Class, a schema object definition could do: > > package MyApp::Fork; > > sub spear { # ... > } > > package MyApp::Spoon; > > sub scoop { # ... > } > > package MyApp::Schema::Spork; > > use base qw( DBIx::Class MyApp::Fork MyApp::Spoon ); > > # ... $spork->can('scoop') && $spork->can('spear') > # ... 0 < scalar map $spork->isa("MyApp::$_"), qw( Fork Spoon ); > > ### > # or the inverse relationship: > > package MyApp::Silverware; > > use base qw( MyApp::Kitchen::Utensils ); # etc. etc. > > sub sort_pieces { > # a class method sort algorithm, i.e. spoons > forks > knives > } > > sub sound { > # play resonance sound based on subclass > } > > sub bend { > # only for psychics and charletans > } > > package MyApp::Schema::Spoon; > > use base qw( DBIx::Class MyApp::Silverware ); > > package MyApp::Schema::Fork; > > use base qw( DBIx::Class MyApp::Silverware ); > > package MyApp::Schema::Knife; > > use base qw( DBIx::Class MyApp::Silverware ); > > # ... > > Then you can arrange your files and their base classes in a more or > less direct mapping to the cognitive entities of your system. > > Mark > > > > 10.02.08, 20:07, "Dave Rolsky" <au...@ur...>: > > > > > On Sun, 10 Feb 2008, Victor Porton wrote: > > > > I need OO<->MySQL mapper which supports class hierarchies (derived > > > > classes, inherited classes). That is I want the retrieved object > > > > automatically to become of some of derived classes (the class with which > > > > I have stored it) when I retrieve an abstract base class object. > > > > > > > > The Web page http://poop.sourceforge.net/ is lacking to point for every > > > > object store module whether it supports inheritance. > > > > > That's a bit old these days. I _suspect_ you want something like Tangram. > > > |
From: Ray Z. <rz...@co...> - 2008-02-12 14:59:35
|
Another option is SPOPS with the SPOPSx::Ginsu extensions. -- Ray Zimmerman Senior Research Associate 428-B Phillips Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 On Feb 10, 2008, at 11:44 AM, Victor Porton wrote: > I need OO<->MySQL mapper which supports class hierarchies (derived > classes, inherited classes). That is I want the retrieved object > automatically to become of some of derived classes (the class with > which I have stored it) when I retrieve an abstract base class object. > > > > The Web page http://poop.sourceforge.net/ is lacking to point for > every object store module whether it supports inheritance. > > > > Please add to the list which mappers support inheritance. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Poop-group mailing list > Poo...@li... > https://lists.sourceforge.net/lists/listinfo/poop-group |