Re: migration from jsf to wicket

2009-02-05 Thread uwe janner
again thx to all the people so helpful on this mailing list!! this fact was
an important argument to  convince my customer to take wicket into account!

i migrated a little part of our old struts1 app  to both seam/jsf and
seam/wicket to compare the performance degradation when going from naked
struts to a component oriented framework;

jsf managed to serve 20 pages per second, wicket was the clear winner with
100 pages / second!
see my comment on
http://ptrthomas.wordpress.com/2009/01/14/seam-jsf-vs-wicket-performance-comparison/#comment-13386

wicket is really great in providing high level web development without
sacrificing performance!!

cheers, uwe!

On Thu, Jan 29, 2009 at 8:04 PM, dtoffe dto...@yahoo.com.ar wrote:


For 1) I suggest you to take a look at Wicket Web Beans:

  http://wicketwebbeans.sourceforge.net/

 Cheers,

 Daniel



 janneru wrote:
 
  martin  john,
 
  thank you very much for your ideas!
  this helps me very much to make the next steps, i will post the results
  when
  the integration is done!
 
  bestregards, uwe!
 
 

 --
 View this message in context:
 http://www.nabble.com/migration-from-jsf-to-wicket-tp21724080p21733565.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: migration from jsf to wicket

2009-01-29 Thread Martin Makundi
 1) working with many attributes of an object
 we have some pages where we access many attributes of an object, say we want
 to show all 20 attributes of a person and all 10 attributes of
 person.getAddress();
 in the PersonPage.java i would have to add 30 label (or input) components,
 30 lines with nearly identical java code: add(new Label(firstName,
 person.getName() );
 isn't it tedious to always keep PersonDetails.java and PersonDetails.html
 files in sync? in jsf/jsp the changes are only in the jsp/xhtml

There are few options that come into my mind:
1. add(new Label(CONSTANT_FIRST_NAME, person.getName() ); // Now you
can re-use your constant from WicketTests.
2. add(new Label(CONSTANT_FIRST_NAME, new PropertyModel(person,
Person.NAME_CONSTANT) ); // Now you can re-use your Entity's NAME
-constant from JPA/ORM/Hibernate queries.
3. use CompoundPropertyModels. Yes. You will have to sync the names in
html and in Java. Maybe someone will develop a nice plugin that
automates this in the future:
http://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels
http://cwiki.apache.org/WICKET/more-on-models.html

 2) page composition
You can treat Title just as a Label. See wicket:head tag and Wicket
modularity:
http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html
http://www.javalobby.org/java/forums/t60926.html
http://cwiki.apache.org/WICKET/create-dynamic-markup-hierarchies-using-panels.html

 3) preview functionality
 is this right: as soon as we use page composition and components, the
 preview feature is gone; how do you experienced wicket users handle this? is
 it usable in a prototype phase - before the html prototype is decomposed
 into composition parts and components?

The runtime page hierarchy is ofcourse visible only at runtime, but
you can preview each panel separately ofcourse (if it makes sense).

 is there a resource on the web that helps with the task of migrating from
 jsf to wicket?

I would save the html files using a browser (if the html markup is not
available separately) and just pick up from there, starting to add
wicket:id's to the components of the page, one-by-one (in development
 debug mode it is quite fast as you do not need to restart the jetty
server after savedcompiled change).

my 2 cents ;)

**
Martin

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: migration from jsf to wicket

2009-01-29 Thread John Krasnay
On Thu, Jan 29, 2009 at 12:41:31PM +0200, Martin Makundi wrote:
  1) working with many attributes of an object
  we have some pages where we access many attributes of an object, say we want
  to show all 20 attributes of a person and all 10 attributes of
  person.getAddress();
  in the PersonPage.java i would have to add 30 label (or input) components,
  30 lines with nearly identical java code: add(new Label(firstName,
  person.getName() );
  isn't it tedious to always keep PersonDetails.java and PersonDetails.html
  files in sync? in jsf/jsp the changes are only in the jsp/xhtml
 
 There are few options that come into my mind:
 1. add(new Label(CONSTANT_FIRST_NAME, person.getName() ); // Now you
 can re-use your constant from WicketTests.
 2. add(new Label(CONSTANT_FIRST_NAME, new PropertyModel(person,
 Person.NAME_CONSTANT) ); // Now you can re-use your Entity's NAME
 -constant from JPA/ORM/Hibernate queries.
 3. use CompoundPropertyModels. Yes. You will have to sync the names in
 html and in Java. Maybe someone will develop a nice plugin that
 automates this in the future:
 http://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels
 http://cwiki.apache.org/WICKET/more-on-models.html
 

RepeatingView can also come in handy...

  RepeatingView rv = new RepeatingView(field);
  add(rv);
  String[] props = { firstName, lastName, ... };
  for (String prop : props) {
rv.add(new Label(rv.newChildId(), new PropertyModel(person, prop));
  }

If you have something more complex than a Label, just substitute your
own custom panel.

  2) page composition
 You can treat Title just as a Label. See wicket:head tag and Wicket
 modularity:
 http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html
 http://www.javalobby.org/java/forums/t60926.html
 http://cwiki.apache.org/WICKET/create-dynamic-markup-hierarchies-using-panels.html
 

One common approach is to use markup inheritance, then have the parent
class expose overridable methods.

  public abstract class BasePage extends WebPage {

public BasePage() {
  add(new Label(title, new AbstractReadOnlyModel() {
public Object getObject() {
  return getPageTitle();
}
  }));
}

public abstract String getPageTitle();
  }

  public class PersonPage extends BasePage {

public PersonPage(PageParameters pp) {
  // load person object based on pp
}

public String getPageTitle() {
  return getPerson().getName();
}
  }

The trick here is to avoid calling the overridable method directly from
the base class constructor (else we'd call PersonPage.getPageTitle
before the person was loaded). That's what the AbstractReadOnlyMethod
thing is about.

  3) preview functionality
  is this right: as soon as we use page composition and components, the
  preview feature is gone; how do you experienced wicket users handle this? is
  it usable in a prototype phase - before the html prototype is decomposed
  into composition parts and components?
 
 The runtime page hierarchy is ofcourse visible only at runtime, but
 you can preview each panel separately ofcourse (if it makes sense).
 

It's important to note that everything outside the wicket:extend tag
(for markup inheritance) or the wicket:panel tag (for panels) is
ignored by Wicket. You can therefore use this to create a reasonable
harness for previewing...

  html
head
  !-- normally included by BasePage, we include it 
   here to enable preview --
  link rel=stylesheet href=../BasePage.css/
/head
body
  h1My Panel Preview/h1
  wicket:panel
...
  /wicket:panel
/body
  /html

But ultimately the point of a component-based framework is to avoid
copying boilerplate around, so if you're looking for previews of
fully-formed pages you're doing it wrong.

jk

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: migration from jsf to wicket

2009-01-29 Thread janneru
martin  john,

thank you very much for your ideas!
this helps me very much to make the next steps, i will post the results when
the integration is done!

bestregards, uwe!

On Thu, Jan 29, 2009 at 11:41 AM, Martin Makundi 
martin.maku...@koodaripalvelut.com wrote:

  1) working with many attributes of an object
  we have some pages where we access many attributes of an object, say we
 want
  to show all 20 attributes of a person and all 10 attributes of
  person.getAddress();
  in the PersonPage.java i would have to add 30 label (or input)
 components,
  30 lines with nearly identical java code: add(new Label(firstName,
  person.getName() );
  isn't it tedious to always keep PersonDetails.java and PersonDetails.html
  files in sync? in jsf/jsp the changes are only in the jsp/xhtml

 There are few options that come into my mind:
 1. add(new Label(CONSTANT_FIRST_NAME, person.getName() ); // Now you
 can re-use your constant from WicketTests.
 2. add(new Label(CONSTANT_FIRST_NAME, new PropertyModel(person,
 Person.NAME_CONSTANT) ); // Now you can re-use your Entity's NAME
 -constant from JPA/ORM/Hibernate queries.
 3. use CompoundPropertyModels. Yes. You will have to sync the names in
 html and in Java. Maybe someone will develop a nice plugin that
 automates this in the future:

 http://cwiki.apache.org/WICKET/working-with-wicket-models.html#WorkingwithWicketmodels-CompoundPropertyModels
 http://cwiki.apache.org/WICKET/more-on-models.html

  2) page composition
 You can treat Title just as a Label. See wicket:head tag and Wicket
 modularity:
 http://cwiki.apache.org/WICKET/wickets-xhtml-tags.html
 http://www.javalobby.org/java/forums/t60926.html

 http://cwiki.apache.org/WICKET/create-dynamic-markup-hierarchies-using-panels.html

  3) preview functionality
  is this right: as soon as we use page composition and components, the
  preview feature is gone; how do you experienced wicket users handle this?
 is
  it usable in a prototype phase - before the html prototype is decomposed
  into composition parts and components?

 The runtime page hierarchy is ofcourse visible only at runtime, but
 you can preview each panel separately ofcourse (if it makes sense).

  is there a resource on the web that helps with the task of migrating from
  jsf to wicket?

 I would save the html files using a browser (if the html markup is not
 available separately) and just pick up from there, starting to add
 wicket:id's to the components of the page, one-by-one (in development
  debug mode it is quite fast as you do not need to restart the jetty
 server after savedcompiled change).

 my 2 cents ;)

 **
 Martin

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: migration from jsf to wicket

2009-01-29 Thread dtoffe

For 1) I suggest you to take a look at Wicket Web Beans:

  http://wicketwebbeans.sourceforge.net/

Cheers,

Daniel



janneru wrote:
 
 martin  john,
 
 thank you very much for your ideas!
 this helps me very much to make the next steps, i will post the results
 when
 the integration is done!
 
 bestregards, uwe!
 
 

-- 
View this message in context: 
http://www.nabble.com/migration-from-jsf-to-wicket-tp21724080p21733565.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org