Visual Java



Email    print   
July 15, 2005 —  (Page 1 of 2)
I recently stumbled across JSR 273, “Design-Time API for JavaBeans,” on the jcp.org site. This is a new Java Specification Request that was originally contemplated for Mustang (J2SE 6), but which will probably be released after Mustang ships next year. The point of this JSR is to extend the JavaBeans 1.01 spec to make it easier to integrate a JavaBean-compliant component that you write into a design-time container. (I’m talking primarily about visual components that appear in a user interface and are manipulated by a design-time Visual Basic-like layout tool; these sorts of beans have nothing to do with EJBs, for example.)

The main reason I find this JSR interesting is that the original JavaBeans specification was responsible for introducing the getter/setter idiom to Java, an idiom that’s fundamentally at odds with the object-oriented principle of implementation hiding. The result is that there are a lot of procedural programs written in Java by people who think that they’re programming in an object-oriented way. Overuse of getter/setter functions causes serious maintenance problems, and can obviate most of the advantages of OO systems.

Interestingly, the original JavaBeans spec didn’t mandate that you use a getter/setter idiom. The point of the idiom was to tag certain attributes of an object for inclusion in a tool-generated property sheet. That is, if you provided getFoo() and setFoo() methods, then a design-time tool would include a Foo property in the property sheet for that component. The spec provides for a much more object-oriented way of doing the same thing: A BeanCustomizer could create an arbitrary property sheet for a component, thereby rendering the getter/setter functions unnecessary.

The problem was that nobody understood how to build a customizer. The specification itself was responsible for this problem. The section on customizers was both sketchy and much harder to understand than the rest of the document. More to the point, the spec included no discussion of why you might want to use a customizer. The net result is that nobody did use them, and as a consequence a lot of bad code has been written.




Pages 1 2 


Share this link: http://sdt.bz/28727
 
Most Read Latest News Blog Resources

Add comment


Name*
Email*  
Country     


  • Comment
Loading




close
NEXT ARTICLE
Microsoft to ship jQuery with Visual Studio
The popular open-source JavaScript library will be fully supported by Microsoft. The company is also planning to ship a version of jQuery that is designed to work better with Visual Studio Read More...
 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 

Download Current Issue
FEBRUARY 2012 PDF ISSUE

Need Back Issues?
DOWNLOAD HERE

Want to subscribe?


 
blogs tab
Are you at risk for burnout?
Burnout is a severe problem and it can strike at any time. Here's how to tell if you are nearing the edge.
02/09/2012 02:16 PM EST

Agility, mom, and apple pie
If we're to evaluate the state-of-the-art in software development, we should start with the values espoused in the Agile Manifesto.
02/07/2012 11:57 AM EST

RIM woos developers with free tablet
How do you get more apps ported to the BlackBerry PlayBook? By giving every developer a free tablet, of course!
02/04/2012 01:57 PM EST

GitHire: Use Headhunters to Find Your Perfect Programmer
Are you a hiring manager tired of scouring the job boards? Check out this new service that will find 5 people interested in your jobs.
02/03/2012 12:17 PM EST

Facebook claims hacker cred
Facebook's SEC S-1 filing form includes a short essay on the Hacker Way by Mark Zuckerberg himself.
02/02/2012 08:26 AM EST

Ryan Dahl steps down
Ryan Dahl, creator of Node.js, steps back from his position as gatekeeper for the project.
02/01/2012 04:58 PM EST

 
Events calendar tab
2/13/2012 to 2/16/2012
Santa Clara
TechWeb

2/26/2012 to 2/29/2012
San Francisco
BZ Media

2/27/2012 to 3/2/2012
San Francisco
RSA

3/4/2012 to 3/7/2012
Las Vegas
IBM Tivoli

3/5/2012 to 3/9/2012
San Francisco
TechWeb