Service is a coarse grained object. Usually acts as a facade to a subsystem or a module.Service will not maintain state. It will have workflow within it and will interact with Business Objects to perform any business operations. It also provides the support for Service Oriented Architecture (SOA). Business Objects are domain specific objects. They perform business operations or workflow. In a banking application, the business objects would be Account, Manager, Cash, Teller, Ledger etc.
All properties (attributes) of a business object is contained in a value object. The base class will have id, name and mode as its attributes Since business objects are generally heavy with implementation details, it will be difficult to transport them. That’s why all attributes are separated out in a value object. A one-to-one relationship between value objects is defined in its corresponding business objects also. A one-to-many relationship between value objects will not be defined in the business objects due to memory considerations.
Business Objects contains a Data Access Object (DAO) for performing CRUD (Create, Read, Update, Delete) operations. Care should be taken to close the database connection in a finally block of try/catch.
Below is a sequence diagram of how various components of AdhiC interact. The service will call a business method on a BO and the BO will in turn call its DAO and populates its VO. Then the VO can be used to get various attributes
To download AdhiC Framework, please click here