On Wed, Feb 5, 2014 at 11:25 PM, Arialdo Martini
<[email protected]> wrote:
> Hi Nikolaos.
> I'm very interested in achieving the same results you are trying to achieve.
>
> After having read the amazing post Rails is not your application I started
> taking into consideration a very different approach.
> I asked myself: is it that important that the view callable is subjected to
> dependency injection? What if I move the application one layer down, and use
> Pyramid only to drive my application and expose it to to web, rather than to
> build it?

This can often be a good approach, so that your business logic is not
dependent on the framework and can potentially be used with other
things. Put only the direct interface to the input and template into
the view.  You can put it all in the model, or put a layer above the
models (if you want to keep the models limited to table definitions).
The tradeoff is complexity. I wouldn't do it in a simple application
where it would be relatively easy to extact the logic from the views
if I needed to someday, but it can be helpful in a larger more complex
application. At any rate it keeps clear what the business logic is,
and it can be unit-tested separately.

What do you mean by dependency injection? Who's injecting what into
what? The only injections I know of are links that Fanstatic or
ToscaWidgets injects into the HTML for static assets.

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" 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/pylons-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to