On Sunday 17 Apr 2011 19:20:28 Pouyan Zachar wrote:
> [pouyan]
> >> httpserver delivered with the Java 6 is only a simple webserver and is
> >> not a servlet container. on the other hand I don't think that it would
> >> be complicated to imitate some vital functionalities of a servlet
> >> container
> >> Those for MVC architecture say "Ayeeeee"
> [Ian]
> > MVC is a nobrainer, the hard question is *which* MVC framework.  Criteria
> > are:
> >
> > Shallow learning curve (since regardless of which we choose, its likely to
> > be unfamiliar to some developers)
> > Lightweight (so that it doesn't increase the size of Freenet's
> > distributable)
> > Well supported
> > Pleasant to use
> > Ian Clarke
> 
> We are not "forced" to choose between existing frameworks. IMHO,
> Building a lightweight framework tailored for Freenet is the best
> solution for the current situation. Following tools are needed:
> 
> 1. A servlet container (I suggest Jetty) [or adapt already existing
> "SimpleToadletServer"]

If we are building our own why do we need servlets? Aren't they significantly 
more complex even than toadlets?

Not that I'm necessarily opposed. Maybe there is stuff we can use usefully 
which isn't gigantic?

> 2. A templating engine (Velocity is suggested)

Yes, a fast templating engine is definitely a good idea. It would make for 
cleaner code, easier to modify the UI and also faster than HTMLNode's.
> 
> And following steps must be taken:
> 
> i. Build a controller servlet/toadlet which handles http requests and
> redirects them to responsible Toadlet. Servlet/Toadlet can be
> configurable using a XML file (just like Struts) e.g managing
> forwardings.

Currently we just hardcode registrations by URL. This is low priority imho.

> ii. Adapt Toadlet class to template engine and provide a mechanism to
> register desired properties and methods to the templates context (can
> be done elegantly using annotations).

This is a good idea. If the former is a prerequisite for this then okay.
> 
> After doing so we have our own simple and configurable framework which
> is based upon MVC architecture and suits freenet needs. The only
> remaining step is to externalize toadlets view in JSP-like HTML pages
> (which are processed by template engine). Moreover a toadlet can have
> different views for different needs, so you could have all those fancy
> javascript effects beside simple lame HTML elements.

Right. The bulk of the work will be converting the code to use the templates.
> 
> In case of Velocity, because of simple notation and tidy syntax, the
> learning curve would be minimum, it is well supported however it is
> not that pleasant to use :) but its a tradeoff between simplicity and
> pleasure!

Can you show a small easy to understand example?
> 
> This way we would make sure that the framework is as big as necessary
> and as small as possible by avoiding all unnecessary features provided
> by existing frameworks.

Yeah, if this is feasible then it makes sense.

It also leaves out the question of what to do about javascript/GWT, which IMHO 
is separate and can if necessary wait for another GSoC.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Devl mailing list
[email protected]
http://freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to