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] Builder Refactoring #636

Closed
gossi opened this issue May 15, 2014 · 3 comments
Closed

[RFC] Builder Refactoring #636

gossi opened this issue May 15, 2014 · 3 comments
Labels

Comments

@gossi
Copy link
Contributor

gossi commented May 15, 2014

Hey,

I was extending the code generation library schmittjoh/cg-library to add support for traits and interfaces (my fork) because I want to use it in one of my further projects (still in dev!). I was wondering how Propel would look like using this codegen lib in conjunction with twig. So I hacked some lines together to get an impression. I pushed the code: builder-refactoring branch.

Basically the code is located in Propel\Generator\Builder\Model and the parts are available in Propel\Runtime\Parts.

This would offer:

  • Programmatically add code
  • Twig as template system for method bodies or strings (for being used in docblock)
  • Create code templates and use reflection to template them (PhpMethod::fromReflection(...))
  • Move static code into traits and just include them
  • Include abstract methods in traits and implement them on the object

With static code I mean code, that is the same across all generated objects and doesn't vary on model contents

Let me know what you think

@mpscholten
Copy link
Member

👍 Love the idea but the builder code base is huge. IMO it's not possible to refactor all the code at once.

@marcj marcj added the RFC label Jul 15, 2014
@marcj
Copy link
Member

marcj commented Jul 15, 2014

Yepp, maybe for Propel > 2.X.

@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