> > 1) why do the setters have to return void?
> 
> Since that's what the JavaBeans specification dictates. To analyze beans
> we use the standard JDK Introspector API:
> http://java.sun.com/j2se/1.5.0/docs/api/java/beans/Introspector.html
> 
> > 2) why are setters necessary at all? What if you have read-only
> > properties in your bean, is it not reasonable to want to display them
> > in your template?
> 
> The reason is consistency. You will 99% of the time populate the bean
> from values (resquest, database, ...) and then display it. If all
> getters would be displayed, you can get a lot of unwanted values that
> appear (imagine all the getXXX() methods that exist).
> 
> I hope this helps.

Yes it does, thanks very much Geert for answering my questions. It's clearer
to me now.

It's not a big deal to me not to use method chaining in my beans, I much prefer
having the beans work properly with templates.

Frederic


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to