Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

Bhawna Behl Roll no-11026 CSE-1(A)

Assignment 1

Ques.1 Differentiate between traditional approach and object oriented approach?


Both traditional approach and object oriented approach have its own strengths and weaknesses. The primary difference between both these approaches is how a problem is decomposed. Traditional methodology is either data centric or process centric. But object oriented views system as collection of both data and processes. Object oriented approach use UML to describe the system concept as a collection of objects which incorporate both data and process. Traditional methodology introduces the use of modeling techniques to describe systems basic business processes and the data that support the processes One of the advantages with waterfall model is that the system requirements are identified long before the beginning of the programming phase. The changes to the requirements become minimized as the system development proceeds. But the problem with the structured approach is the design of the proposed system should be completely specified prior to the programming phase of the system development. This causes a long time gap between completion of the system proposal and delivery of the final system which results in poor communication mechanism. Because of this time gap between the initial proposal of the system and the final introduction, the users will not be prepared for the new system. In object oriented system a functional model of real world system is developed in the analysis phase itself. This allows the users to get

Bhawna Behl Roll no-11026 CSE-1(A)

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).

Bhawna Behl Roll no-11026 CSE-1(A)

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

Q2.Discuss and differentiate between Inheritance and Aggregation?


Aggregation :- Aggregation is a special case of association. A directional association between objects. When an object has-a another object, then you have got an aggregation between them. Direction between them specified which object contains the other object. Aggregation is also called a Has-a relationship. Aggregation represents the set of Main Classes that are dependent on Sub-Classes, the Main class cannot exists without Sub-Class but the Sub-Class can exists without the Main Class. If we see from programming point of view we use Aggregation in almost every class module but it is responsibility of the Architect or the Business Analyst who

Bhawna Behl Roll no-11026 CSE-1(A)

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

Bhawna Behl Roll no-11026 CSE-1(A)

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"); }

You might also like