advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

Reviews : New Tricks With Design Pattern: Java Value Types :

Combining JVT with Other Patterns

We have shown above some advantages in using the JVT with the ServiceLocator pattern. When used with a Session Facade pattern, the value types can entirely hide the technology being used for data access or management. This means the user or web service interface can make logical requests on the Session Facade to exchange value types with the data access or management sub-systems. This can eliminate the dependence on a single data access technology such as CMP entity beans, JDO, etc. Projects can often migrate from one to another or use a combination of both methods where appropriate. The extra plumbing JVTs provide are excellent for managing stateful objects in a multi-threaded environment such as that of web services and/or web applications.

Value Types in a Team Environment

When used in a team environment the value objects and value types lend themselves to better enabling parallel efforts. One such method uses "mock" value types to enable complete development and testing of a web or rich client user interface prior to completion of the data access and EJB frameworks. These "mock" value types are the actual classes used by an application but with test values used to emulate those produced by or sent to the data access and/or EJB components. Another benefit utilizes the JUnit testing framework to fully test the EJB and value types without adding the complexity of the user interface classes.

The ability to make mock JVT's makes it really easy for different teams to work on different tiers at the same time. It also allows for parallel development of separate parts of the same tier (like different session facades for web services, jms, etc). The testing advantages are valuable in that you can not only use the mock JVT's as mock input for a module, but you can also have a mock JVT that the output of a module should match. If you implemented the JVT equals method properly, you can easily compare the actual output and the desired output. Mock JVT's also make prototyping easier. JVT's force the designer to make clear separations between modules and to clearly define what data will move between them. It forces the designer to also realize when they are changing the interface (in that they must have changed the JVT).

Summary

JVTs provide an efficient vehicle for transporting information to the technologies that act upon them. JVTs can be a very useful pattern in designing and developing flexible object models. The decoupling of technologies and the simplification of access between the design layers can make projects far more maintainable, testable and adaptable to new technologies. This design pattern is intended as a beefier set of value objects that can significantly streamline medium to complex J2EE projects. When combined with utility classes using reflection they can simplify object transport and access in everything from processing JMS messages to exporting XML representations of your objects.


About the Author

Noah Horton is an R&D Engineer at Hewlett-Packard. He has been programming in Java for five years and specializes in enterprise system design with Java.


How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

 Microsoft Visual Studio 2010 Showcase
 Avaya Developer Showcase
 MSDN Spotlight
 PHP for Windows Showcase
XML error: undefined entity at line 39
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

Windows 7: From Beta to Final Code in One Year
Google Shows Off Chrome OS, Releases Source
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?
Fedora 12 Takes Aim at Linux Networking
Top Supercomputer Nearly Doubles in Speed
Fedora 12 Linux Tackles Virtualization
Apple Gives iPhone Developers App Status Tracker
Novell Sets OpenSUSE 11.2 Free

Creating Custom Export Filters for StarOffice with XSLT
WPF Wonders: Using DataTemplates
Crystal Reports Family Offers Options for Developers
Avaya Aura Session Manager video
Avaya Aura Overview video
Exploring HTML 5's Audio/Video Multimedia Support
Overriding Virtual Functions? Use C++0x Attributes to Avoid Bugs.
Understanding the Cloud Computing Security Vulnerabilities
Cisco and IBM Target a Greener World
Upgrade to Visual Studio 2010 with the Ultimate Offer

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs