Thread: The Java Bean ?
View Single Post
Old 04-24-2004, 03:08 AM   #8 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,161
Belisarius is on a distinguished road
It's generally considered good form in Java to access an object through methods rather than public fields. You could access a public field in a bean by doing <%=object.field%>, but depending on whom you talk to, it's better to use the tags in order to keep seperation between the parts of MVC.

Why they chose this particular route for the get/setProperty tags was probably due to the fact that your get/set methods might be more complex than just referencing a String variable (you might access a database), at which point referencing a field won't do you a lot of good.
__________________
GitS
Belisarius is offline   Reply With Quote