|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.dataobjects.DataTransferObject
Basic HashMap wrapper for the Data Transfer Object pattern. The goal of this class is to provide efficient serialization over the wire of DBOBjects and or the up and coming DataObjects. By encapsulating the 'data guts' of the data objects into this class, routing programs that don't have to know anything about a particular instance of a DBObject/DataObject don't have to have any large code base installed on them.
The other advantage of DataTransferObject is serialization size. On tests conducted 3/17/04, the size of com.jcorporate.expresso.services.dbobj.MimeTypes was 1310 bytes. The size of the same item converted into a DataTransfer object was 293 bytes. For in-memory serialization alone, this translates to twice as fast. For slower connections such as sockets, this speed translation will be more pronounced.
| Constructor Summary | |
DataTransferObject()
|
|
| Method Summary | |
String |
getDataContext()
|
String |
getObjectClassName()
|
Map |
getTableFields()
Gets the table fields in bulk |
void |
readExternal(ObjectInput ois)
Optimized Deserialization |
void |
setDataContext(String dataContext)
|
void |
setObjectClassName(String objectClassName)
Sets the classname of the DataObject we're attached to so that we can instantiate it at the far end of the wire. |
void |
setTableFields(Map tableFields)
Sets the data fields in bulk. |
void |
writeExternal(ObjectOutput oos)
Optimized Serialization implementation that does not utilize any reflection |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DataTransferObject()
| Method Detail |
public void readExternal(ObjectInput ois)
throws ClassNotFoundException,
IOException
readExternal in interface Externalizableois - The Object Input object
ClassNotFoundException - for reading subobjects
IOException - upon I/O error
public void writeExternal(ObjectOutput oos)
throws IOException
writeExternal in interface Externalizableoos - The Object Output Stream
IOExceptionpublic void setTableFields(Map tableFields)
tableFields - the new set of table fields to usepublic Map getTableFields()
public void setDataContext(String dataContext)
dataContext - The new data context to usepublic String getDataContext()
public void setObjectClassName(String objectClassName)
objectClassName - the full classnamepublic String getObjectClassName()
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||