Increasingly, in our spring (or equivalent) wired world of services, the Java code that I see looks more and more procedural, without paying much attention to modeling the problem in OO.
For example, a service in which there is something to do, may well be embedded in the service method in a single-level service - perhaps more than several hundred lines. Alternatively, local methods can be created, but since the service does not have a status, they are always called with a stack (not a pun intended) of the necessary arguments. Its noisy.
Guess maybe my original Smalltalk OO background is highlighted here, but modeling the problem in OO always seemed like a way to me. That is, modeling with objects that have state as well as behavior.
An alternative approach may be to create a prototype delegate with a state called from a service that is either connected or loaded using the necessary ones (entities, singleton DAO / services, etc.). In addition, some other decorators can be created to transfer objects (esp collections) to provide some behavior in the list of models (I have a list of af accounts, I have list-based behavior - this should be a class containing a list, it should not be only the technical class List and its use behavior built into the service (but usually there is))
But.
Creating some objects of this type uses memory, and in a high-throughput environment this can lead to the creation of thousands of small instances of the strategy / decorator. So what is the impact of this real world? Will there be additional GC performance screws or, assuming a JVM instance around a pair of GB, can Java handle it? Has anyone installed Java SOA based on these principles? Are there any documents on this?
Thanks for reading this.
source
share