David,
Aren't I declaring the methods my snippet supports by including them
as public methods of the snippet itself?
I think that requiring every StatefulSnippet to also be a
DispatchSnippet is at odds with the code-by-convention and don't-
repeat-yourself principles. If all my dispatch PF
Willis,
I appreciate your point of view. Getting stuff done more quickly is good.
Having a maintainable, flexible code base is good. Sometimes these things
are at odds.
I've found that over my various projects, using DispatchSnippets is better.
They tend to lead to fewer bugs. That's why I
David,
Thanks for your reply.
I agree with your points about dispatch snippets: they're a good
idea, and I see that it's possible to avoid having to rewrite the
method name several times.
But Lift does provide a reflection-based dispatch mechanism which
could work with stateful snippets but
It's better practice to use DispatchSnippets. Snippets by convention are
the easy toe in the water, but once you're dealing with state, etc., you
should be graduating to declaring the methods that your snippets support,
thus enforcing the DispatchSnippet being the base class of StatefulSnippet.