Professional Documents
Culture Documents
11026
11026
Assignment 1
information about what the final system must do. The use messages provide better communication between the objects. The encapsulation property of the object oriented methodology allows reuse of the code in different system. This results in significant cost reduction and faster development time. Another characteristic that differentiate both the methodology is the use of different models and designs to describe the system. Structured methodology mainly uses three models to describe the system which are Data Flow Diagram (DFD), Entity Relationship Diagram (ERD) and structured chart. The complexity of diagram used in object oriented approach is much higher than the diagram used in traditional approach. In traditional approach there are clear cut steps to move from one phase to another and at the end of each phase some documentation will be produced regarding to the activities done in that particular phase. But in object oriented approach not only there is no clear cut step in moving from analysis to design and from design to implementation, but also the steps are iterative. This is time consuming and results in repetitive testing throughout the development process of the system. This continues analysis of the system during the development phase offers a much better end product, a system with better efficiency and minimum errors. In object oriented approach there will not be any documents per phase and all the information about the activities in that particular phase will be represented with in the model description. In traditional methodology, system components such as inputs, outputs, database, files and program modules are designed from the data flow diagram (DFD).
Traditional Approach 1. Used to develop the traditional Projects that uses procedural programming. 2. Uses common processes likes: analysis, design, implementation, and testing. 3. Depends on the size of projects and type of projects 4. Needs to large duration sometimes to development the large project 5. The problem of Traditional approach using classical life cycle
Object oriented approach 1. Used to develop Object-oriented Projects that depends on Object-Oriented programming
2. Uses UML notations likes: use case, class diagram, communication diagram, development diagram and sequence diagram 3. Depends on the experience of the team and complexity of projects through the numbers of object 4. Need to more time than Traditional approach and leads that to more cost 5. The object-oriented software life cycle identifies the three traditional activities of analysis, design, and implementation
are designing the UML Diagrams for the System to specify the aggregation relationship between the classes. Aggregation is specified by an hollow diamond. Aggregation in UML Example: Main Class public class Car { Engine eng; } Sub Class public class Engine { private int CC = 0; private int make = 0; private String ModelNo = null; public Engine(int cc,int make,String modelNo) { this.CC = cc; this.make = make; this.ModelNo = modelNo; } }
The above example / diagram indicates that Car aggregates Engine and there is whole/part relationship that is Car is made up of Engine, but Engine can be of Bike/Car so Engine is not dependent on Car. Inheritance A very important concept in object-oriented design, inheritance, refers to the ability of one class (child class) to inherit the identical functionality of another class (super class), and then add new functionality of its own. (In a very nontechnical sense, imagine that I inherited my mother's general musical abilities, but in my family I'm the only one who plays electric guitar.) To model inheritance on a class diagram, a solid line is drawn from the child class (the class inheriting the behavior) with a closed, unfilled arrowhead (or triangle) pointing to the super class. Inheritance refers to is-a relationship wherein derived class inherits common functionality from the base class. To represent Inheritance in UML we draw a line
from derived class to the base class with a closed unfilled arrowhead pointing towards the base class. Inheritance in UML Example: Inheritance Code public class Mammals { private int LEGS = 4; public void walk() { System.out.println("Calling Base Class walk Function"); } } Inheritance Extending Class public class Cats extends Mammals { public void walk() { System.out.println("Calling Derived Class walk Function"); } } public class Dogs extends Mammals { public void walk() { System.out.println("Calling Derived Class walk Function"); }