Java Tutorial - Java Scipt : Creating a Domain Model

Java Tutorial - Java Scipt :

Creating a Domain Model


From the previous section, it should be clear that we will need a class to represent the information we know about a user. This user class is an example of a domain class. Domain classes describe the people, places, and things, or nouns that are a part of the business problem. A domain class is often implemented as the base layer for an application. In our case, the domain classes represent potential Enterprise Java Beans. The UML class diagram shown in Figure 13.3 shows two classes and the relationship between them. The model shows that each user has exactly one graduating class (the number one next to the GradClass box) and that each graduating class has a one-tomany relationship (the 1..* next to the User box) with the users. In reality, some users are faculty members and are associated with many graduating classes. We will handle this case by adding faculty as a separate instance of GradClass. We will use these models as the basis for understanding the application as we develop it.

Normally, we would create a separate class to store information common to a specific Graduation class, however for simplicity we will only provide the User class and associate a user with a Graduating class by collecting the year the user graduated.