Information Technology Reference
In-Depth Information
The case study consists of a distributed Java application which allows a user to
calculate the sum of integer numbers. The distribution is accomplished by means of
sockets. The MVC pattern [12] is applied in order to perform a separation of
representation and control concerns from the functional concerns of an application.
In order to study the crosscutting in this case, we consider three main concerns in
the system: Distribution to Client, Distribution to Server and Calculation. We take
these concerns as source elements in our dependency matrix (see Sect. 3.1) and the
UML design classes are considered to be the target elements.
Fig. 6. UML class diagram of Remote Calculator
In Fig. 6 we show a UML class diagram representing the design. We have
developed the main functionality regarding the socket concerns in a class called
SocketConnection. This class just performs the remote connection and sends and
receives integer values. We may say that this class has a low cohesion. Depending on
the operation (sending or receiving), this class will invoke methods of the other
classes. The Model, View and Control classes perform the actions to sum the integer,
read user's selections and shows the results on screen respectively. Therefore, the
application has a good separation between model (a class with a vector of numbers
and which performs the sum), view (a class which shows the result on the screen) and
control (a class which reads the user's inputs). Although such classes are coupled by
means of method calls, their level of cohesion is high because each class is only
addressing its main functionality (concern).
Table 9. Dependency and crosscutting matrix for the Remote Calculator
dependency matrix
classes
concerns
SocketConnection
Model
View
Control
Distribution-to-Client
1
0
0
0
NS
Distribution-to-Server
1
0
0
0
NS
Calculation
0
1
1
1
S
T
NT
NT
NT
Search WWH ::




Custom Search