Week 13: Wrap-up Refining Class Diagram and Implementation MSIS 670: UML Models Week 13: Wrap-up Refining Class Diagram and Implementation 11/16/2018
Refining the Class Diagram From Activity Diagram and Sequence diagram, add the classes needed. Identify more attributes (instance variables) and methods needed. Modify relationships: e.g., an application class uses a data type, “has a” GUI, etc. Visibility: instance variables = private or protected, methods = public or private A tip for using class diagrams (from analysis to implementation): Don't try to use all the various notations on offer. Start with the simple stuff: classes, associations, attributes, and generalization. Introduce other notations only when you need them. Sort out which perspective you are drawing the models from. If you are in analysis draw conceptual models. When working with software, concentrate on specification models. Draw implementation models only when you are illustrating a particular implementation technique. Don't draw models for everything, concentrate on the key areas. It is better to have a few diagrams that you use and keep up to date than many forgotten, out-of-date models. 11/16/2018
Creating Random Access Files “WriteAccessFile”, “ReadAccessFile”, “UpdateRecord”, and “CreateAccessFile” are applications which extends JFrame interface. Applictaion has a user interface (GUI) of BankUI as a component, which in turn has Button and Field as its own componnets. The application interacts with RandomAccessAccountRecord, which extends AccountRecord (SequentialFile), and thus inherits from it its attributes and methods. Figure 1 11/16/2018
Implementation a Skelton Java code for classes will be created. 11/16/2018
A Skeleton Code Declare public class ClassName Attributes be its instance variables Class diagram relationships for object references Declare methods from third compartment 11/16/2018
Step 2: define instance variables Step 1: declare class Step 2: define instance variables Step 3: reference to objects Step 4: define methods Just to illustrate the steps to create a class code, Figure 2 illustrates a sample skeleton code for an application “TransactionProcessor”. Of course this is not complete nor compilable. Figure 2: Example of application skeleton code 11/16/2018
Figure 3: Example of GUI skeleton code 11/16/2018
Figure 4: Example of file skeleton code 11/16/2018