|
From: Jeremy T. <jer...@gm...> - 2006-03-25 18:30:57
|
I also agree that it is a nice concept, but I think adoption will be
hurt by the constant re-deploy problem. We use Jetty in Eclipse as
well, but depend on being able to make Tapestry page changes and see
them immediately with a refresh. We wouldn't be able to use something
that required a re-gen, compile, restart web server cycle. I, too,
look forward to seeing the samples.
Jeremy Thomerson
eBay, Inc.
On 3/25/06, Steven Devijver <ste...@gm...> wrote:
> Cristian,
>
> I think the Java generation can be useful in the early stage of the
> Wedge framework, but I'm with Seth in that the binding code should
> eventually be autogenerated, preferably with a tool like ASM.
>
> Wedge looks promising, and I would like to see a sample application
> that demonstrates its features, like for example complex form
> hanlding, validation, AJAX and so on.
>
> Steven
>
> On 3/25/06, Cristi PASCU <cri...@cr...> wrote:
> >
> > Thank you very much for your reply!
> >
> > When I started to work on 'wedge' my objective was to have a framework
> > does not require either specific page class hierarchy or cluttered
> > templates.
> > The solution I came up with for achieving this was to have "the missing=
"
> > code generated. First, I used javassist to create and load classes at
> > runtime. I rapidly realized that this is not such a good idea because:
> > 1. The generated code is invisible to the developer. Any exception that
> > you get at runtime would be hard to debug if it occurred within this
> > generated code. 2. There are a few limitations when using javassist. Fo=
r
> > instance, it does not supports inner or anonymous classes. 3. Class
> > loading problems that may occur within a web container environment.
> >
> > Although I would like very much to come with a 'cutting [w]edge' web
> > framework, I believe that it is more important to have that attitude
> > that will keep us moving further. Wicket came up with a good change of
> > view and perspective on java web development. As I studied some wicket
> > example I was impressed by the simplicity of the xhtml templates and th=
e
> > elegancy of the java classes. Still, I try move things a little bit
> > further. I want also to have clean java code, that is, to minimize the
> > dependency of the application to the framework. In a wedge application,
> > the framework takes your code and integrates it within its generated
> > classes. In wicket applications you build your pages using specific
> > framework components into the java code. That impose the creations of a
> > lot of java objects, one for each component. For instance, take this
> > example:
> >
> > In wicket:
> >
> > this.add(new Label("message", "Hello World!"));
> >
> > <span wicket:id=3D"message">Message goes here</span>
> >
> > This code must create a tree of components the must be synchronized wit=
h
> > the template and rendered by passing through it recursivly.
> > ---------------------
> >
> > In wedge:
> >
> > public String getMessage() {
> > return "Hello world!";
> > }
> >
> > <span wid=3D"w:insert" value=3D"ognl:message">The message</span>
> >
> > This gets translated into:
> >
> > render("<span >");
> > render(usrComp.getMessage());
> > render("</span>");
> > ---------------------
> >
> > As you can see, only a instance of the object behind the page is needed=
.
> > The component (w:insert) is translated into code. All wedge components
> > are translated into code and will not do any action at runtime.
> >
> > Embedding your code into the framework code frees your applications fro=
m
> > compatibility breaking with future versions of wedge. If your
> > application consists of pages that are simple POJO's than framework
> > improvements for performance and clarity of the generated code will not
> > affect the application code. And I think this is good thing. Backward
> > compatibility is something that makes evolution of frameworks slower.
> >
> >
> > Yes, you need to restart the application and regenerate the code as you
> > make changes to the pages. But:
> > 1. I use jetty as an embedded server which is very practical and rapid
> > way to develop application. It does not take to much time to restart th=
e
> > server.
> > 2. I've made the ANT task only for generating the pages. The generation
> > requires all the application to be on the class path such that I start =
a
> > new java process to do that. This takes time, about 5 sec for my 5 page=
s
> > app. With the following code the time reduces to 1 sec.
> >
> >
> > String base =3D "D:/PROJECTS/wedge/wedge.test.site/";
> >
> > WedgeCodeGenerator codeGenerator =3D WedgeCodeGenerator.getInstance();
> > String webRoot =3D base + "web";
> > codeGenerator.setWebRoot(webRoot);
> >
> > String sourceRoot =3D base + "wdg/src";
> > codeGenerator.setSourceDir(sourceRoot);
> >
> > String wedgeApp =3D "wedge-application.xml";
> > String appSpec =3D webRoot + "/WEB-INF/" + wedgeApp;
> > codeGenerator.setWedgeApplication(appSpec);
> >
> > codeGenerator.generateFiles();
> >
> >
> > 3. If I refresh the eclipse project folder, the eclipse compiler
> > compiles the files much faster than ANT.
> > 4. An eclipse plug-in would be quite helpful! (Note that the simplicity
> > of the framework will make possible to have a powerful enough IDE
> > plug-in)
> >
> >
> > About defaults and conventions, I have been thinking to introduce them.
> > But still, I need a way to figure out which spring beans are wedge
> > components and which are not. More, you are not bound to spring, you ca=
n
> > simply specify the class directly. For the file attribute, you can
> > specify any kind of path that XmlWebApplicationContext can manage. The
> > file name is not always suitable for being an id. Anyway, you are right=
,
> > if is possible, that the developer should have the possibility to use
> > this conventions.
> > Unfortunately I do not see how I can make the wedge framework to work
> > without any kind of information source. Anyway, the amount of xml will
> > be kept to the minimum.
> >
> > Thank you very much for your interest and I will try that a.s.a.p to
> > have a first release and more documentation.
> >
> > Help on developing is really needed! If there is anyone interested,
> > please contact me!
> >
> > Cristian
> >
> >
> >
> > -----Original Message-----
> > From: spr...@li...
> > [mailto:spr...@li...] On Behal=
f
> > Of Seth Ladd
> >
> > Sounds like an interesting project. Can you compare to Wicket
> > (http://wicket.sourceforge.net/) ?
> >
> > The one concern I have is, how quick is it to test changes to the code?
> > From the impression I get, if I want to make a change to a page, I need
> > to shut down the application and restart it so that the ANT task can
> > recompile the page classes?
> >
> > IMHO, a really cutting edge Java web application framework would requir=
e
> > absolutely zero shutdown and restarts of either the servlet container o=
r
> > the servlet context itself. Do you happen to plan on attacking the
> > "constant redeploy" problem?
> >
> > Also, not sure if it does already, but does the configuration support
> > sensible defaults, or conventions? A really cutting edge Java web app
> > framework would be able to run with zero XML.
> >
> > For instance, given your example:
> >
> > <application>
> >
> > <page id=3D"home" file=3D"home.html" springBean=3D"home" />
> >
> > </application>
> >
> > I would image the default rule would be: "convert home.html to 'home'
> > and find the matching bean by name". In other words, don't make me
> > write the above XML when it's obvious what I am declaring. :)
> >
> > Seth
> >
> >
> > On 3/24/06, Cristi PASCU <cri...@cr...> wrote:
> > > Hi everybody!
> > >
> > > My name is Cristian Pascu and I am developing an opensource project
> > > named "wedge" (http://wedge.sourceforge.net) which is a component
> > > centric web framework built on Spring.
> > > It is similar to Tapestry and aims to provide some features that are
> > > not yet available in Tapestry. Namely:
> > > * better and easier integration with Spring.
> > > * simple POJO classes behind clean xhtml pages. There is no
> > > need to extend specific framework classes. The classes are easy to
> > > test as they are easy to instantiate and configure.
> > > * all page classes may be managed by Spring inversion of
> > > control container. This way, services from the business tier will be
> > > injected in the presentation tier.
> > > * a simpler component/pages specification. There should be a
> > > single configuration file and not one for each component.
> > > * the configuration of the application should be very simple,
> > > one xml file with few tags and attributes. Much of the configuration
> > > will be on the spring side.
> > >
> > > Most of these features are already implemented. There is still some
> > > work to do on the validation mechanism. The upload support is also
> > > missing but is not to hard to implement.
> > >
> > > But what differentiate the wedge framework from tapestry framework is
> > > that instead of using runtime reflection it follows the "code
> > > generation" paradigm. Let me be more specific: The connection between
> > > the template and the class behind it is made through an intermediary
> > > generated class that binds the two. Thus, the generated code "knows"
> > > exactly which is the structure of the template, that components to
> > > render, what classes to use and what methods to call at the right
> > time.
> > > The generation is done with an ANT task each time before the
> > > application is started.
> > >
> > > If you have any thoughts on what I am trying to do, critics or
> > > advices, all are welcomed!
> > >
> > > Do you think that such a framework is needed?
> > > Do you think that my approach is a good one?
> > >
> > > Thank you very much!
> > >
> > > Cristian
> > >
> > >
> > > PS: There is not any release yet. You may check out the project from
> > > sourceforge: https://svn.sourceforge.net/svnroot/wedge
> > >
> > >
> > > -------------------------------------------------------
> > > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > > language that extends applications into web and mobile media. Attend
> > > the live webcast and join the prime developer group breaking into thi=
s
> > new coding territory!
> > > http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid$1720&dat=121642
> > > _______________________________________________
> > > Springframework-developer mailing list
> > > Spr...@li...
> > > https://lists.sourceforge.net/lists/listinfo/springframework-develope=
r
> > >
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> > language that extends applications into web and mobile media. Attend th=
e
> > live webcast and join the prime developer group breaking into this new
> > coding territory!
> > http://sel.as-us.falkag.net/sel?cmd=3Dk&kid=110944&bid$1720&dat=121642
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
> >
> > -------------------------------------------------------
> > This SF.Net email is sponsored by xPML, a groundbreaking scripting
> language
> > that extends applications into web and mobile media. Attend the live
> webcast
> > and join the prime developer group breaking into this new coding
> territory!
> > http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid$1720&dat=121642
> > _______________________________________________
> > Springframework-developer mailing list
> > Spr...@li...
> > https://lists.sourceforge.net/lists/listinfo/springframework-developer
> >
> >
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting langua=
ge
> that extends applications into web and mobile media. Attend the live webc=
ast
> and join the prime developer group breaking into this new coding territor=
y!
> http://sel.as-us.falkag.net/sel?cmdlnk&kid=110944&bid$1720&dat=121642
> _______________________________________________
> Springframework-developer mailing list
> Spr...@li...
> https://lists.sourceforge.net/lists/listinfo/springframework-developer
>
>
>
|