OOPs Assignment
SUBMISSIONS : 10 March 14
Q 1) What is Abstract Class? Give an example to explain and compare with concrete class.
Abstract Class use abstract methods i.e. methods that are only declared, but not defined in that class. These classes do not have any direct instance in the system. It is done so because the further sub-classes which use these methods can define them according to their needs.
Concrete classes have direct instances. The methods are declared and defined in this class only.
_________
| Employee | ---> (abstract class)
----------------
|
/\
-----------------------------------------
| |
---------------- ----------------
| Full Time | | Part Time | ---> ( concrete classes)
----------------- ----------------
for example- take a instance E_ID; it is declared and defined in class EMPLOYEE, and shared by classes 'FULL TIME' and 'PART TIME', but for an instance "PAY"; it may be declared in class EMPLOYEE, but defined differently for classes 'FULL TIME' and 'PART TIME'.
Q 2) Compare OOAD with SA/SD?
Abstract Class use abstract methods i.e. methods that are only declared, but not defined in that class. These classes do not have any direct instance in the system. It is done so because the further sub-classes which use these methods can define them according to their needs.
Concrete classes have direct instances. The methods are declared and defined in this class only.
_________
| Employee | ---> (abstract class)
----------------
|
/\
-----------------------------------------
| |
---------------- ----------------
| Full Time | | Part Time | ---> ( concrete classes)
----------------- ----------------
for example- take a instance E_ID; it is declared and defined in class EMPLOYEE, and shared by classes 'FULL TIME' and 'PART TIME', but for an instance "PAY"; it may be declared in class EMPLOYEE, but defined differently for classes 'FULL TIME' and 'PART TIME'.
Q 3) Explain JSD with example?
It is an approach for object oriented design in which the time factor is the vital factor and is described by using sequence of events. JSD is applicable to the application where efficiency plays a vital role.The fundamental principle of JSD is that it focuses on describing the real world by the system i.e. its main focus is to map the progress in the real world rather than specifying the functions performed by the system i.e its main focus is to map the progress in the real world. JSD consist of three stages:
1. Modeling Stage – This Stage comprises of Entity Action and Entity Structure. The entity structure diagram has been created and identifies the entities and their actions.
2. Network Stage – Initial model step, Function Step, and System Timing Step. A set of sequential is expanded into a process network by addition of process for handling messages for external environment and generating system output.
3. Implementation Stage – Implementation Step. In initial model step we concentrate on state vector and data stream communication. A data stream is an unbounded queue where read operator extracts the next record from the queue, in state vector we are present all the possible states of an entity.
Example -
1. Modeling Stage – This Stage comprises of Entity Action and Entity Structure. The entity structure diagram has been created and identifies the entities and their actions.
2. Network Stage – Initial model step, Function Step, and System Timing Step. A set of sequential is expanded into a process network by addition of process for handling messages for external environment and generating system output.
3. Implementation Stage – Implementation Step. In initial model step we concentrate on state vector and data stream communication. A data stream is an unbounded queue where read operator extracts the next record from the queue, in state vector we are present all the possible states of an entity.
Example -
Q 4) What is the role of constraint in DFD. Draw DFD for following-
- Hotel Management
- Library Management
- Payroll System
- Online Shopping
Constraints are the functional dependency between object that are not related to an input/output dependency. Constraints can be on two objects at same time, between instances of same object at different time or between instances of different object at different time. It can be categorised into two parts-
- Pre-Condition - These are conditions on functions that satisfy the input value.
- Post-Condition - These are condition on function that output values are guaranteed to with.
Hotel Management
Payroll System
Online Shopping
Q 5) What is Functional Modelling? Compare with Object and Dynamic Modelling.
- Pre-Condition - These are conditions on functions that satisfy the input value.
- Post-Condition - These are condition on function that output values are guaranteed to with.
Hotel Management
Functional modelling describes the computational behaviour of a system for its functions.
Q 6) Prepare a State Diagram for Telephone Answering Machine.
Q 7) Differentiate between-
- Link and Association
- Aggregation and Generalization
- Data Abstraction and Encapsulation
- Polymorphism and Operator Overloading
Link | Association
- Relationship among objects. | Relationship among classes
Types - > Types - >
- One to one | Unary Association
- One to many | Binary Association
- Many to one | Ternary Association
- Many to many | Quaternary Association
- Relationship among objects. | Relationship among classes
- One to one | Unary Association
- One to many | Binary Association
- Many to one | Ternary Association
- Many to many | Quaternary Association
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.
Example: Bank has Accounts.
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.
Example: Bank has Accounts.
Generalization
Generalization uses a “is-a” relationship from a specialization to the generalization class. Common structure and behaviour are used from the specialization to the generalized class. At a very broader level you can understand this as inheritance. Why I take the term inheritance is, you can relate this term very well. Generalization is also called a “Is-a” relationship.
Example: Student is-a Person.
Data Encapsulation: Data Encapsulation is the process of combining data and functions into a single unit called class. By this method one cannot access the data directly. Data is accessible only through the functions present inside the class. Thus Data Encapsulation gave rise to the important concept of data hiding.
Data Abstraction: It is a process of exposing only the interfaces and hiding the implementation details from the user. The interface exposed will remain the same: even if the internal implementation changes. This helps the user to use the new functionality without rewriting the client that was designed for previous implementation.
Operator Overloading is creating a operator with the same name with parameters which are of another type.
Polymorphism is about changing the implementation / functionality of a specific method across various types (which all have the same 'base-type').
Generalization uses a “is-a” relationship from a specialization to the generalization class. Common structure and behaviour are used from the specialization to the generalized class. At a very broader level you can understand this as inheritance. Why I take the term inheritance is, you can relate this term very well. Generalization is also called a “Is-a” relationship.
Example: Student is-a Person.
Data Encapsulation: Data Encapsulation is the process of combining data and functions into a single unit called class. By this method one cannot access the data directly. Data is accessible only through the functions present inside the class. Thus Data Encapsulation gave rise to the important concept of data hiding.
Data Abstraction: It is a process of exposing only the interfaces and hiding the implementation details from the user. The interface exposed will remain the same: even if the internal implementation changes. This helps the user to use the new functionality without rewriting the client that was designed for previous implementation.
Data Abstraction: It is a process of exposing only the interfaces and hiding the implementation details from the user. The interface exposed will remain the same: even if the internal implementation changes. This helps the user to use the new functionality without rewriting the client that was designed for previous implementation.
Operator Overloading is creating a operator with the same name with parameters which are of another type.
Polymorphism is about changing the implementation / functionality of a specific method across various types (which all have the same 'base-type').
Q 8) Write down all the steps required for OMT Methodology.
OMT consists of building a model of an application and then adding details to it during design. Object Modelling Technique has following steps:
- Problem Formation: Problem statement is used to understand the problem and requirement.
- Analysis: This phase takes problem statement and produce object,dynamic and functional model for a system.
- Design: It is further classified into two classes:
- System Design: It defines the resource allocation.It is also used for making a strategy by attacking a problem during analysis.
- Class Design: It combines the three models to obtain operation on classes.Class design also implements the object on behalf of algorithm.This design phase is also used to package classes and associations into modules.
4. Implementation: On the basis of software design document the problem is solved by using any OOPS language.language. Implementers translate the classes and relationship developed during class design into a particular programming language,database or hardware.







