On 27 Jun., 23:19, Fabien POTENCIER <[EMAIL PROTECTED]>
wrote:
> Matthias N. wrote:
> > The only thing I don't like is the sfFactoryConfigHandler and the fact
> > that the factories(.yml) are all instantiated during initialize()
> > What about moving the object creation and initialization from the
> > foreach/switch into a factory method in the respective classes. And
> > only pass parameters from factories to the factory() method. Thus
> > these objects could be lazy loaded. For example move it into
> > sfRequest::factory(), sfResponse::factory(), sfController::factory(),
> > sfUser::factory().
> > This would also make it possible to cache factories.yml as array which
> > seems to get very important in context of making symfony faster.
>
> Hmmm, this is a good idea but I think we will have some problem with the
> initialization ordering. All factories are created in a first pass, then
> initialized() in a second pass to satisfy dependencies. So, I'm not sure
> we can move this to each object factory. I will have a look later to see
> if it's posiible. Thanks for the suggestion.
>
This could be solved by an additional "dependency" parameter containig
a list of all names of the objects that must be instantiated before.
E.g.
dependency: [request, response]
As you can put this param into symfony/data this should be no BC
problem with factories.yml
>
> > I have another suggestion for 1.1 related to enhancement of the view
> > layer and a theme plugin I would like to contribute this August:
> > I would like to have "virtualization of views". What's that? Well.. I
> > would like to have the possibility to override/change module/action/
> > template at all relevant places. Not sure but I guess the places are
> > sfPHPView, get_partial() and get_component() helpers. I don't want to
> > change anything with the default behavior of loading templates but I
> > need a way to hook into it. I need to change template sources to
> > arbitrary other locations. I think the best solution for that is to
> > move the loading/locations of templates into a
> > "sfTemplateLocatorAdapter" !? Like you already did with sfRouting!
>
> The View system is also one of the sub-framework I want to refactor for
> 1.1 or 1.2. I want to create 2 distinct layers: a view layer and a
> template layer. This distinction will allow easier integration of
> templating systems like phptal or smarty. The link between the view and
> the template will be done via a new sfTemplateContext object. This
> object will hold all the variables to be passed to the template
> (instance variables from the action or the global ones created by sfView
> - sf_*). It will allow the developer to inject some global variables
> into the template context and to use the templating system for partial
> without initializing a new view object (so, it will be much faster).
> This object will also holds the helper objects... Yes, I also want to
> convert helpers to classes (This is one of oldest design changes we
> discussed here on the ML).
Oh these are good news. As I wrote: The most important thing for me is
that there is a possibility to change the location of templates by an
own implementation. And I think some sort of a locator adapter would
solve this very fine.
I think the sfTemplateContext object should simply be a "sfContext
factory object", so we can access it by $context-
>get('templateManager') or similar as this is a nice place to keep
arbitrary context objects like that.
Just let me know if you want me to help you with some of these things.
Regards,
Matthias
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---