Java Reference
In-Depth Information
In a class diagram, the hollow-diamond adornment indicates a part-whole relationship
between the classes. This is called an 'aggregation. On the other hand, the solid-diamond
adornment represents a composite relationship between the classes. A composition is
stronger than an aggregation in that the former involves a complete management of the
lifetime of the object. For example, at runtime, an EmployeeDao object is responsible for
allocation and deallocation of the DbConnection object. The Employee object is allocated
by the EmployeeDao but deallocated by the EmployeeDocData or EmployeeRpcData
object.
The dotted-line boxes indcate the boundaries of the two libraries to be created for this
application.
4.2.2 Write Data Access Class
The Data Access Object (DAO) design pattern is used to provide abstract and encapsulated
access of data from the data sources. It manages the connection with the data source to
store and retrieve data.
First, we create a Java project called 'data-svc' (see section 7.2.1). After we complete our
coding of the Java classes, this project should appear as follows:
Search WWH ::




Custom Search