Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Buildtime object model #42

Closed
fzaninotto opened this issue Nov 10, 2011 · 7 comments
Closed

[RFC] Buildtime object model #42

fzaninotto opened this issue Nov 10, 2011 · 7 comments
Labels

Comments

@fzaninotto
Copy link
Member

The classes under the Generator/Model/ directory help to model the relational schema. The problem is that at buildtime, there is no model of the object-oriented domain. The code necessary to generate ActiveRecord, TableMap, RelationMap, is all inside Relational classdes - or worse, builder classes.

I suggest that we introduce an object-oriented view of the model at buildtime - something like the runtime Map classes, but more intelligent - and to make these classes the primary data for PHP builders. SQL builders can keep using relational models, but PHP builders need a central place where they can look for a reference of the Object model.

@hhamon
Copy link
Member

hhamon commented Nov 10, 2011

Can we create a new Propel\Mapping namespace containing classes that allow to map the model for Buildtime and Runtime?

@fzaninotto
Copy link
Member Author

@hhamon: No thrilled about this idea. The buildtime model must be very detailed, the runtime model must be very fast. These need to be different classes.

@hhamon
Copy link
Member

hhamon commented Nov 10, 2011

Ok I didn't know there were so much differences between the two models ;)

@willdurand
Copy link
Contributor

Ok, I'm fine with that.

Will we duplicate information or it's really different ? Except granularity, I'm not sure information are so different. I agree the need to have different classes but we may introduce the Propel\Common top-level namespace to avoidduplicating stuffs. It's just a suggestion, I didn't exactly know information you want in the generator.

Or maybe I didn't get your sentence "something like the runtime Map classes, but more intelligent".

I'm fine with that anyway, it will be a first step in the refactoring of builders.

@fzaninotto
Copy link
Member Author

Let's bootstrap these classes for the builder needs, to see what's needed
inside. For the most part, these classes will use the relational model to
give back information, but presented in an OO way. For instance, in a
Record class, there will be a getOneToManyRelationships() method
returning Relation objects, based on the FKeys of the underlying tables.

2011/11/10 William DURAND <
[email protected]>

Ok, I'm fine with that.

Will we duplicate information or it's really different ? Except
granularity, I'm not sure information are so different. I agree the need to
have different classes but we may introduce the Propel\Common top-level
namespace to avoidduplicating stuffs. It's just a suggestion, I didn't
exactly know information you want in the generator.

Or maybe I didn't get your sentence "something like the runtime Map
classes, but more intelligent".

I'm fine with that anyway, it will be a first step in the refactoring of
builders.


Reply to this email directly or view it on GitHub:
#42 (comment)

@willdurand
Copy link
Contributor

Yeah, totally needed.

@dereuromark
Copy link
Contributor

I will close these stale and old tickets.
We can open new ones as per needs, but they are just collecting dust here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants