Hi,
I have following queries on class diagram.
1. while designing classes, do we show only business classes in class diagram or can we show DB, VO, facade classes along and their association with business classes?
2. I wanted to know if my approach is correct. Take an example where I have a System configuration module which is used to configure the system by adding/updating/deleting configuration items.
In this scenario, my classes would be System Configuration and Configuration Items and System Configuration has Configuration items. I thought of defining Configuration Item as a ValueObject with Getter and setter methods and System Configuration would have a business methods to add ConfigurationItem, DeleteConfigurationItem, UpdateConfigurationItem, getConfigurationItems. In the System Configurtion class I am not thinking of holding ConfigurationItems collection as a paramter, as I would be returning that from getConfigurationItems method and ConfigurationItems are probably built in DB class and returned to Business class. I was thinking of sending ConfigurationItem as a method parameter to add/update/delete method. In this case, how will I represent the relationship between confgurationItem and SystemConfiguration. I see it as a composition relationship but I am not holding ConfigurationItems as a list in SystemConfiguration class.
I have my all classes like this. I have moved class attributes into valu objects and designed a seperate class for business methods. But by this I thinking I am not able to capture the correct relationship between business classes but I am capturing relationship between value objects.
I am not sure If my approach is correct or wrong. I would appreciate if anyone could take me to correct direction if I am going in wrong direction.
3. I am confused with association and dependency relationship. If one class is accessing a method on the other class then do we show that relationship using dependency?
I see association relationship as having other class instance as an attribute in a class. For example, if A and B are associated with each other and association is bi directional, then A would contain an instance of B as an attribute (i m not sure if it is class attribute or method atribute) and B would contain object of A as an attribute.
I would appreciate if anyone help me in differentiating between both.
4. I am thinking of having a 4 tier architecture.
1-tier- web component (
jsp,
struts)
2-tier - Facade classes that lookup for
EJB 3-tier - EJB classes
4-tier - DB classes
Do we show all classes along with struts, facade, EJB, VO and DB in class diagram?.