On Mar 30, 2009, at 9:38 PM, Adam Heath wrote:

David E Jones wrote:

This has been discussed a few times and I think is on a few of the lists
around were people have brainstormed on things they'd like to
add/change/etc. I'm personally very in favor of it and I do believe it
has been needed for a long time.

Why not add support in the entity engine for proper entity extension?
What I mean, is like the case for Party/Person/PartyGroup.  Instead
of having to fetch/update/etc each of those entities separately, the
entity engine will treat the sub-tables as one, and deal with a single
entity during manipulation.

If a developer asks for a Party, they will actually get a
Person/PartyGroup, with all the correct fields.  If they ask for a
person, they will either get the wanted value, or maybe a CCE if it is
the other type.

I've had thoughts about this for a while, but never concrete enough to
turn into code.  I'm mostly just dumping my brainstorming onto the
list.  Anyone else have any thoughts?

I thought about this a bit early on in the design of the entity engine. It is one of the reasons why the PartyType entity has a tableName field, and one of the early possible uses of the relation(ship) stuff.

The problem is that the higher level code knows about how the entities fit together and what things mean (because the programmer knows what they mean), so they can create view-entity defs and such and use them as needed for the application. The trick is to get the entity engine to do the same... ie do things in more efficient queries so there it doesn't have to do multiple calls to the database (ie get the Party, look at the partyTypeId, then get the corresponding info). It could do fully inclusive left-joins (ie including all other entities with a certain relationship type, or that are type one with the same pk field(s)) to get everything available and then figure it out after the query is done.

Anyway, I suppose it could be done... the code would still have to look at the type or something to see which fields are available... interesting to think about anyway...

-David

Reply via email to