[jboss-user] [JBoss Seam] - Re: Avoiding the DRY Principle with beans

bfo81 do-not-reply at jboss.com
Tue Jul 11 05:17:32 EDT 2006


Mh... template method pattern, very beautiful. I'm messing around with JSF frameworks and example codes for a while now, and I often wondered why no one did it like this before.

I'd like to add something. I believe you can implement the setObject()-method in the abstract class PersistenceBean, too, since it should be the same in alle inheriting classes.


BUT: What about casting? I mean when you access the employee, e.g.
<h:outputText value="#{employee.name}" />
then JSF accesses the getName() method of the employee object. But since this one is a java.lang.Object and not a Employee I fear that we might get a MethodNotFoundError. Or is the reflection mechanism in Java smart enough for this?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3956905#3956905

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3956905



More information about the jboss-user mailing list