|
It is bad practice to use transport layer specific objects in the business layer. All JSON objects should be translated to real POJOs to allow clean and better method signatures.
Right a JsonCommand is created and provided as arguments to the Service layer. We want to offer a real internal API in the future and for this we need to provide proper method signature.
Needed changes:
-
Refactor CommandWrapper to use a generic payload not a JSON string
-
Allow setting the entity, action, and href in CommandWrapper to create a new instance
-
Refactor all Services to use the real data objects
-
Refactor CommandProcessors to use GSON to serialize the CommandWrapper payload for storing and replay
-
Use JsonCommand only for data input via the REST API
|