On Thu, Jan 15, 2009 at 1:44 PM, Tobias Marx <[email protected]> wrote:
> Hi there!
>
> There are some things in Wicket I am missing and I think they could improve
> the framework a lot.....
>
> But just some small background first:
>
> In my opinion the most important things in a web application are:
>
> - as few lines of code as possible, as many as really necessary
what good is a few lines if they are not maintainable? in wicket we
try to focus on the maintainability of the code first, not on the LOC
it takes to accomplished X. Further in your email you hint at moving
things into markup where everything a string and nothing is validated
by a compiler - this, while might be the quickest and easiest
approach, leads to unmaintainable code down the road. it also defines
behavior in two places instead of one, leading to more confusing code.
> - separation of design and web application code and logic
>
> - if a webapplication changes in the design or some small items are added
> this should be possible without needing a java developer....
this is possible to a large degree in wicket already, keeping in mind
that wicket's definition of "design" is very strict.
> Therefore I would like to suggest more intelligent templates in Wicket:
>
> 1. Pass parameters inside of wicket components eg:
>
> <div wicket:id="myComponent" paramA="blabla" paramB="blabla2"></div>
>
> and make them accessible in the Java code.
you can do this. override oncomponenttag(tag) {
paramA=tag.getattributes().get("paramA"); }
> This is a way to customize and reuse components purely by editing templates
like i said earlier, this is not really wicket's philosophy.
everything that affects behavior should be in java.
> 2. Make Strings/Labels accessible directly in templates....to avoid redundant
> code like this:
>
> add(new Label("indexTitle", .....) and instead allow to add properties
> directly.
see wicket:message tag and attribute.
> 3. Pick up components automatically without needing to add them in the Java
> code:
>
> add(new LastPostsPanel("lastPostsPanel"));
> add(new NewsPanel("newsPanel"));
>
> This could be matched automatically
you can accomplish this via IComponentResolver, there was a thread
recently on the list about this. getting back to maintainability -
this forces you to put the class name as a string into the template,
what happens when you rename or move that class?
-igor
> I think Wicket could be better without so much redundant copy&paste code...by
> improving templates....
>
> Thanks for listening...
>
> Toby
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]