Re: tablename/guid vs. classname/guid

Piotras <pp-VVDi8QVAvoBWk0Htik3J/[email protected]>
Newsgroups gmane.comp.web.midgard.devel
Message-ID <[email protected]>
Torben Nehmer <[email protected]> wrote:

> > Class name means type name defined in schema.
> 
> Can you give me your reasoning for the class/type-name strategy please?

Sure.

$object = mgd_get_object_by_guid($guid);

1. Scenario with tablename&id 

SELECT realm , id from repligard where guid=$guid;
Returned value is topic,3. Now we have X types which uses table topic.
What should be selected from topic table?

2. Scenario with typename&id

SELECT typename , id from repligard where guid=$guid;
Returned value is my_db_superclass,3.
new instance of my_db_superclass is created and got by id 3.

Real example could use midgard_group and org_openpsa_organization.
Both types use grp table. But use different columns.

Of course get_by_guid method shouldn't make any repligard table lookups. 

Piotras
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.