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] remove static initialization of TableMap #361

Closed
jaugustin opened this issue Apr 21, 2013 · 9 comments
Closed

[RFC] remove static initialization of TableMap #361

jaugustin opened this issue Apr 21, 2013 · 9 comments

Comments

@jaugustin
Copy link
Member

We need to find a good way to initialize the TableMapclasses and remove the static call
TableMap::buildTableMap() at the bottom of each TableMapclasses

Maybe we could use :

  • composer class mapping (to auto discover classes)
  • use the propel container
  • ...
@willdurand
Copy link
Contributor

Can we live with these static calls by now?

@deadbeef84
Copy link

What about using some sort of singleton-pattern for the TableMap-classes? Are there any reasons to create multiple instances?

Another problem with the static calls is that you get different results in the DatabaseMap depending on what classes have been loaded. Would it be possible to let the DatabaseMap know about the tables when loading propel configuration?

@hhamon
Copy link
Member

hhamon commented May 11, 2013

A factory object to create and initialize the corresponding Table map?

@fzaninotto
Copy link
Member

Bike shedding imho.

Le 11 mai 2013 à 11:55, William Durand notifications@github.com a écrit :

Can we live with these static calls by now?


Reply to this email directly or view it on GitHub.

@jaugustin
Copy link
Member Author

@willdurand yes we can but it would be better to remove it before beta otherwise we are going to keep those lines forever ;)

@deadbeef84 I think we can generate a classmap with the builder and give it to the tablemap with propel configuration

@marcj
Copy link
Member

marcj commented Feb 1, 2014

Generating a DatabaseMap for each database used in the schemas could solve that. E.g. \DatabaseMap\BookstoreMap extends \DatabaseMap\Base\BookstoreMap that contains then relations to all containing tables and can act as a factory.

@NobleUplift
Copy link

@fzaninotto This is definitely not bikeshedding. When used incorrectly TableMaps can blow out memory.

@dereuromark
Copy link
Contributor

@mringler Can we close this with latest changes done?

@mringler
Copy link
Contributor

Yes, we handled this. Let's close the issue.

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

No branches or pull requests

9 participants