Design Your Own Domain Model to Take Full Advantage of GUI Frameworks

Current generation GUI frameworks such as Oracle's ADF provide excellent support for connecting GUI views and controllers with simple models based on Java Beans, and standard Java types such as String and BigDecimal.

HDR's RIM Objects use classes that implement the HL7 abstract data type specification. These data types are not JavaBeans and cannot be used directly by GUI frameworks without writing conversion routines. Because HDR RIM Objects are defined in terms of RIM Datatypes this also precludes their direct use by many GUI frameworks.

An obvious solution to this problem is to write the appropriate conversion utilities. The details describing how to do this vary from one GUI framework to another. This approach therefore has the potential to tie your application to a particular GUI framework, although you avoid the overhead of creating your own model.

An alternative approach is to convert HDR Objects into JavaBeans that are defined in terms of other JavaBeans and standard Java types. This framework-friendly model could then be used with any GUI framework that supports JavaBean components for its model. This model does not require a 1:1 mapping with the RIM; it might well represent a simplified model used by your business interfaces.

All things being equal, we recommend taking the second approach. Defining your own domain model using JavaBeans lets your business logic layer be more easily ported from one GUI framework to another, and you will have a ready made, simplified set of objects to pass to your business interfaces.