Introducing Domain Model Transportation Framework
POJO based persistence (e.g. Hibernate,
EJB3.0 Persistence
API) makes enterprise software architecture possible to have
a well defined Domain Model which consists well modeled Domain logic.
But for a particular client application (view), you just need part of
the Domain Object graph, not the whole Domain Model.
Domain Model Transport Framework allows your client side bring back
part of your domain model anyway you want.
Key features:
- Selective Object transport:
which related object need to be transported to client side, is
configurable
- Selective Object Attribute
Transport: which object attribute need to be transported to
client is configurable
- Multiple transport schema
configuration: For same object, you can define how to transport
them to client as many ways as you want
- Mix transportation protocols:
In your object graph, your different object can have different
serialization protocol. They can either implement java.io.serailizable
(will be streamlized use default Serialization), or implement
java.io.Externalizable with your own writeExternal(), readExternal()
implementation, or have implement java.io.Externalizable with DMT
version of writeExternal() and readExternal() implementation, or
implements java.io.Externalizable with DMT version of writeExternal()
and readExternal() combine with your own implementation.
- It is fast: Even if you
use DMT framework
out of box, transport the whole object graph, the data size is
significantly reduced - compare to default Java Serialization. The
distribution contains a tools let compare the data size use DMT vs use
Default Java Serialization.( See how
to compare the data size to default java serialization).
- Do not need create new class: You
don't need create any new class to use this framework, all you need to
do is provide a configuration file to specify how do you want to
transport your object. There is a eclipse plugin makes your
configuration very easy to do. You just need select the
object/attributes you want to transport for your schema, then the
configuration file is generated.
- Total replacement to Data
Transfer Object Pattern: Since you can select how to transfer
your object in attribute level, you don't need DTO at all.
- Reuse domain logic: Since
what you get back to the client side is your domain model, your well
defined domain logic is ready to reuse.
- No Proxy generated or Class
loading manipulation: Since most of the persistence tools use
dynamic proxy, and some AOP use Class loading manipulation, we try to
avoid that in case they cause conflict. There is no class loading or
dynamic proxy conflict with
the technology you used.
- Does not interfere with your own
Externalizable implementation: DMT use java externalizable
mechanism, but it has the flexibility to allow you provide your own
implementation (although you don't really want to do so)