Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
Hello! The time is now <%= new java.util.Date() %>
This is not necessarily a good idea for larger projects though.
PHP: a fractal of bad design (fuzzy notepad)
Posted Apr 17, 2012 11:16 UTC (Tue) by alankila (subscriber, #47141)
I personally use wicket for everything. But there's a bit of boilerplate there: you have to subclass WebApplication, and you must at the very least define the class which implements the web page rendered at the root of the website. Then you must give an implementation of that Page (the class file can be empty), then you get to write HTML.
I think that templates should have no evaluation capability whatsoever. In wicket's case, dynamic elements are marked with an xml attribute called wicket:id, for instance <div wicket:id="foo"/>, and then it's up to the Page to choose what is rendered into the element identified by name foo. The state of page is entirely on server side. Components can be replaced in the page tree to generate different kind of elements on the page dynamically in response to user interaction. For instance, foo could start out without content, but become replaced with a modal dialog instead when user interacts with some button or link on the page.
The real problem is with understanding the evaluation model. Wicket gives you an impression that you are actually working with a desktop application, because page instances are kept alive on server and access to the same page will automatically preserve the state of the members, so you get state saving for free. That means improved chance to write secure code, as you don't have to write things into form hiddens, or put them into session hashmap where multiple tabs/windows in same session could trample all over each other. But most astonishingly: page instances are versioned, and requests so if the user uses back button, wicket actually resurrects an earlier version of the page to handle that request, which cleanly allows user to back out from choices made earlier (provided they did not cause permanent state changes to components outside wicket).
Posted Apr 17, 2012 13:07 UTC (Tue) by canatella (subscriber, #6745)
So yes for a newbie/amateur, PHP was the easy/quick solution.
Posted Apr 17, 2012 19:24 UTC (Tue) by drag (subscriber, #31333)
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds