|
|||||||||
| Home >> All >> org >> jeteam >> bean >> [ common overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.jeteam.bean.common
Class DTOFactory

java.lang.Objectorg.jeteam.bean.common.DTOFactory
- public class DTOFactory
- extends java.lang.Object
The DTOFactory is a utility class that centralizes the code that converts a data transfer objects (DTOs) into value objects. Value objects are representations of the domain, similar but very much simpler than the actual entity beans they are associated with. DTOs on the other hand are the client's view of the beans.
For each bean we need an object that can transfer the bean attributes from the service to the entity, in the case of Container Manager Relations we do not include associated bean information in the DTO.
Since a service may need to work with several entity beans it is therefore necessary to centralize the code to create the DTOs, otherwise we risk having duplicate code spread over the services. This class is designed to do exactly that.
As an extra there are method provided that will convert a collection of DTO objects into a collection of DTOs.
For better performance there are also some methods that allow working with
arrays rather than Collection instances, A Collection implies a cast for each
element, this typically is slow and error-prone. Arrays are type-safe.
The DTOFactory is instantiated using the getInstance() method,
there is no public constructor available.
There is also a Factory that works in the other direction: DataFactory
| Field Summary | |
private static DTOFactory |
factory
|
| Constructor Summary | |
private |
DTOFactory()
The constructor is not publicly available as part of the Singleton design pattern, use getInstance() instead. |
| Method Summary | |
org.jeteam.bean.task.NoteDTO[] |
createDTO(NoteData[] datas)
Converts an array of NoteData instances into NoteDTO instances. |
org.jeteam.bean.task.NoteDTO[] |
createNoteDTOArray(java.util.Collection locals)
Converts an array of NoteLocal instances into NoteDTO instances. |
java.util.Collection |
createNoteDTOCollection(java.util.Collection noteLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
org.jeteam.bean.config.PriorityDTO[] |
createPriorityDTOArray(java.util.Collection locals)
Converts an array of PriorityLocal instances into PriorityDTO instances. |
java.util.Collection |
createPriorityDTOCollection(java.util.Collection priorityLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
org.jeteam.bean.security.PrivilegeDTO[] |
createPrivilegeDTOArray(java.util.Collection locals)
Converts an array of PrivilegeLocal instances into PrivilegeDTO instances. |
java.util.Collection |
createPrivilegeDTOCollection(java.util.Collection privilegeLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
org.jeteam.bean.project.ProjectDTO[] |
createProjectDTOArray(java.util.Collection locals)
Converts an array of ProjectLocal instances into ProjectDTO instances. |
java.util.Collection |
createProjectDTOCollection(java.util.Collection projectLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
org.jeteam.bean.security.RoleDTO[] |
createRoleDTOArray(java.util.Collection locals)
Converts an array of RoleLocal instances into RoleDTO instances. |
java.util.Collection |
createRoleDTOCollection(java.util.Collection roleLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
org.jeteam.bean.config.SettingDTO[] |
createSettingDTOArray(java.util.Collection locals)
Converts an array of SettingLocal instances into SettingDTO instances. |
java.util.Collection |
createSettingDTOCollection(java.util.Collection settingLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
org.jeteam.bean.config.StatusDTO[] |
createStatusDTOArray(java.util.Collection locals)
Converts an array of StatusLocal instances into StatusDTO instances. |
java.util.Collection |
createStatusDTOCollection(java.util.Collection statusLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
org.jeteam.bean.task.TaskDTO[] |
createTaskDTOArray(java.util.Collection locals)
Converts an array of TaskLocal instances into TaskDTO instances. |
java.util.Collection |
createTaskDTOCollection(java.util.Collection taskLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
org.jeteam.bean.user.UserDTO[] |
createUserDTOArray(java.util.Collection locals)
Converts an array of UserLocal instances into UserDTO instances. |
java.util.Collection |
createUserDTOCollection(java.util.Collection userLocals)
Returns a new Collection containing data transfer object instances representing the argument local bean collection. |
static DTOFactory |
getInstance()
This method is designed to always return the same DTOFactory instance, it is using a lazy creation strategy where the factory is created the first time the actual call to this method is made, al subsequent calls return the previously created DTOFactory instance. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
factory
private static DTOFactory factory
| Constructor Detail |
DTOFactory
private DTOFactory()
- The constructor is not publicly available as part of the Singleton design
pattern, use
getInstance()instead.
| Method Detail |
getInstance
public static DTOFactory getInstance()
- This method is designed to always return the same DTOFactory instance, it
is using a lazy creation strategy where the factory is created the first
time the actual call to this method is made, al subsequent calls return
the previously created DTOFactory instance.
createNoteDTOCollection
public java.util.Collection createNoteDTOCollection(java.util.Collection noteLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createDTO
public org.jeteam.bean.task.NoteDTO[] createDTO(NoteData[] datas)
- Converts an array of NoteData instances into NoteDTO instances.
createNoteDTOArray
public org.jeteam.bean.task.NoteDTO[] createNoteDTOArray(java.util.Collection locals)
- Converts an array of NoteLocal instances into NoteDTO instances.
createPriorityDTOCollection
public java.util.Collection createPriorityDTOCollection(java.util.Collection priorityLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createPriorityDTOArray
public org.jeteam.bean.config.PriorityDTO[] createPriorityDTOArray(java.util.Collection locals)
- Converts an array of PriorityLocal instances into PriorityDTO instances.
createPrivilegeDTOCollection
public java.util.Collection createPrivilegeDTOCollection(java.util.Collection privilegeLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createPrivilegeDTOArray
public org.jeteam.bean.security.PrivilegeDTO[] createPrivilegeDTOArray(java.util.Collection locals)
- Converts an array of PrivilegeLocal instances into PrivilegeDTO instances.
createProjectDTOCollection
public java.util.Collection createProjectDTOCollection(java.util.Collection projectLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createProjectDTOArray
public org.jeteam.bean.project.ProjectDTO[] createProjectDTOArray(java.util.Collection locals)
- Converts an array of ProjectLocal instances into ProjectDTO instances.
createRoleDTOCollection
public java.util.Collection createRoleDTOCollection(java.util.Collection roleLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createRoleDTOArray
public org.jeteam.bean.security.RoleDTO[] createRoleDTOArray(java.util.Collection locals)
- Converts an array of RoleLocal instances into RoleDTO instances.
createSettingDTOCollection
public java.util.Collection createSettingDTOCollection(java.util.Collection settingLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createSettingDTOArray
public org.jeteam.bean.config.SettingDTO[] createSettingDTOArray(java.util.Collection locals)
- Converts an array of SettingLocal instances into SettingDTO instances.
createStatusDTOCollection
public java.util.Collection createStatusDTOCollection(java.util.Collection statusLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createStatusDTOArray
public org.jeteam.bean.config.StatusDTO[] createStatusDTOArray(java.util.Collection locals)
- Converts an array of StatusLocal instances into StatusDTO instances.
createTaskDTOCollection
public java.util.Collection createTaskDTOCollection(java.util.Collection taskLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createTaskDTOArray
public org.jeteam.bean.task.TaskDTO[] createTaskDTOArray(java.util.Collection locals)
- Converts an array of TaskLocal instances into TaskDTO instances.
createUserDTOCollection
public java.util.Collection createUserDTOCollection(java.util.Collection userLocals)
- Returns a new Collection containing data transfer object instances representing
the argument local bean collection.
createUserDTOArray
public org.jeteam.bean.user.UserDTO[] createUserDTOArray(java.util.Collection locals)
- Converts an array of UserLocal instances into UserDTO instances.
|
|||||||||
| Home >> All >> org >> jeteam >> bean >> [ common overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.jeteam.bean.common.DTOFactory