Hello everybody,

I want to share my toughts and my questions on a philosopical/code design 
scenario:

Let's suppose i want to divide my application in plugins, that interacts 
with the page (view and the template of course) and modify it's aspect if 
the plugin it's loaded and installed in the system.
E.g. i have my menu on the top, and a plugin want to attach some content on 
it that should be viewable.
now i can think of two approach to this: 
1) creating an helper that handles the menu, and the plugins will call that 
helper to add stuff and interact with it 
2) or, a different approach i created a small plugin as PoC to do exactly 
the opposite: https://github.com/mudler/Mojolicious-Plugin-ViewBuilder
The plugin intent is to declare part of the views of the application that 
must be "filled" with plugins, encouraging having small distributions with 
more unit testing that hooks in the view pieces. For example, you will not 
find yourself to add anymore helpers directly to the template, but you are 
going to explicitly declare the template parts, and then the plugins attach 
to it (in someway, i find it really handy, also if the plugin will carry 
part of the view)

It is that a bad approach? Any suggestions/better solution? toughts about 
this? 

Cheers

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to