B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== PART I Q1.
What is object orientation? List the advantages.
Ans. :- Object orientation is a way for organizing as collection of interchanging objects that combine data as will as behavior. Object oriented models are conveniently implemented in software using object oriented programming language. It is applicable to areas such as Hardware, programming language, and databases. User interface, software-engineering etc. When a model is constructed using this in a proper way, then become easy to communicate change, expand and validate. It creates a powerful synergy throughout the development life cycle by combining abstraction, encapsulation and modularity. In object oriented method, the smallest creative part is object. These are grouped into a class when they share the same interface.
ADVANTAGES OF OBJECT ORIENTATION
I.
Data Abstraction: - The data abstraction is defined as the collection of data and function. It focuses on the external view of the object and so server to separate the object’s essential behavior from its implementation. It consists identifying the subject as well as constructing a representation of subject.
II.
Compatibility: - Construct of classes and then interfaces make it easy to combine various software component. It is the another advantage of object orientation.
III.
Flexibility: - Classes made through object orientation provide the units for task allocation in the software development.
IV.
Extensibility: - The software built using object-oriented tequnique tends to be simpler and easier to extend. This is because inheritance enables new classes to be built from old one and the classes together form a loosely coupled structure, which is easier to modify.
V.
Maintenance: - The natural modularity of the class of class make it easier to contain the effects of changes and the use of inheritance property reduces the number of disparate concepts needed to understand the code.
-1-
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== Q2. What are model elements? Discuss stereotypes and tagged values. Ans.: - MODEL WINDOWS - A model window a graphical representation of elements or graphical symbols are used to represent the elements in the diagram. An element can exist several different types of diagram. It is defined with semantic a formal condition of the element or the exact meaning of what it represent in unambiguous statements. An elements can exists in several different types of diagram. Some of the common model elements are:
Class
Object
Attributes
Attributes
Operations
Operations
NODE USERS
STEREOTYPES: - These are the mechanism for classifying or making model element and introducing new types of modeling element. Stereotypes are based on all types of elements-classes, nodes, components and notes as well as relationship such as annotations, generalization and dependencies,. A stereotypes is described by placing it’s name as a string for example <<stereotype name >> around the name of the element as shown below.
<
> Customer
Customer Customer
Whenever an element has to stereotypes, it is used as an element type of specified stereotyped. LAGGED VALUE: - These values are the vary convenient tools to specify property or characteristics of model elements. A tagged value is a pair of string keyword and a value string that stores a peace of information about an element. These keywordvalue pairs are known as property specification, tagged values can be used to store arbitrary values as well as store information about stereotypes model elements.
-2-
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== Tagged values also provide a way to attach implementation dependent add in information to element. For example a code generator needs additional information about the kind of code to generate from a model.
Instruments {Abstract} {Status = “Draft”}
Value = int. expdate : date
Q.3
Explain nodes and connections.
Ans: - NODES - Nodes are physical objects that have some kinds of computational source. Nodes include computers with processors with well as devices such as printers, speakers, communication devices and so on. A node can be shown both a type and instance where a type describes the characteristics of a processors or device type and an instance represents actual occurrences of that type.
Dell Pentium MMX
Jack’s machin Dell Pentium MMX
The DELL Pentium MMX is a node type while jacks machine is a instance of that type. <> HP LaserJet 5MP
-3-
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== CONNECTION: - Nodes are connected to each other by communication associations as shown below . Client:1 Xyz PC
<>
APPLICATI ON SERVER SG02 Client:2 Xyz PC
: Data Base Server: VAX
<>
There are drawn as normal association with straight line indicating that there is some sort of communication path between them with the nodes exchanging objects or messages through the communication path. The communication type is represented by a stereotype that identified the communication protocol used.
----------------------------------------------THE
END-------------------------------------
-4-
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== PART II Q1.
Explain interface and package?
Ans.: - Oriented paradigms. It is intended to be supported by interactive modeling visual tools, which have code generator and report writers. It captures information about, both the static structure as well as the behavior of the system. The structure defines the kinds of objects important to a system as well as the relationship among the objects. The dynamic behavior defines the history of objects over time as the communicators among the objects to accomplish the foal. It intended to be universal general purpose modeling language for discreet system. It can be used to for business modeling, software modeling in all phases of system development. It enables the capturing, communication and leveraging of strategic, tactical and operational knowledge to facilitate increasing value by increasing quality, reducing costs as well as reducing time to market while managing risks. Protected element is available only to packages with generalization to the containing packages. Public elements are available to import package and to the descedent of the package. Packages may have relationship exists between at least some element contain. The diagram can be made using a large rectangle with a smaller rectangle attached an upper left corner of large rectangle. It the content of the packages are not shown, then the name of the package is placed within the large rectangle. Here in the diagram subsystem E is dependent on subsystem B. subsystem C depends on subsystem B and D. subsystem B,C and E are inside the system. All subsystem are represented as packages. Subsystem A Subsystem B
Subsystem C
Subsystem D
-5-
Subsystem E
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== An interface is the general outline of a class showing the methods, the class will have , when someone implements it. It defines the set of externally accessible operations without methods. But it may specify only a limited part of behavior of actual class whereas class can implement many interfaces. It provides the service that is required to any element, which the supplier provides. If a class implements it, it must declare or inherit all the operations in the interface. If a class implement more than one interface then must have to contain each operation found in any of its interfaces. It is a generalisable element that inherits all the operations of its parent with some additional operations. The diagram for interfaces can be made using rectangles or small circles for the name of interface attached. The interface is connected to its mode element via a solid line. Class that uses the interface as implemented in a specific class is connected via a dependency relationship to the interface circle and must be included with the keyword <>. A class that uses the interface may be attached to the circle by a dotted arrow pointing to the circle. Interfaces should not have an attribute compartment. In the diagram it is shown that class A implements interface “man” and “animal”. Class C implements only “man”, class B implements both from A and “man” from C. As:
animal
Class A
Class B man
<> Man {Abstract}
<> Animal {Abstract}
A( )
C( ) D( )
Class C
Packages: Packages are the way of grouping a verity of classes and/or interfaces together. In fact packages acts as a container for classes and/or interfaces. here each name must be unique. It may also contain the subordinate packages or models. By organizing classers into packages following benefits can be found: 1. The classes contained in the package of other programs can be easily reused. 2. It provides a way to hide classes thus preventing other programs or packages from accessing classes. A package defines the visibility of its contained elements as private, public or protected. Private member is not available for all, outside the content
-6-
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== package. Protected elements are available only to packages with generalization to the containing package. Public elements are available to import package and to the descendent of the package. Packages may have relationship to other packages indicating that the relationship exists between at least some element they contain. The diagram can be made using a large rectangle with a smaller rectangle attached to upper left corner of large rectangle. If the contents of the packages are or shown, then the name of the package is placed within the large rectangle. Here in the diagram subsystem E is dependent on subsystem B. subsystem C depends on subsystem B and D. subsystem B, C and E are inside the subsystem. All subsystems are represented as packages.
Q2.
What do you meant by unified modeling language?
Ans: - unified modeling language is generally known as UML. It is a general-purpose visual modeling language, which is used to specify, visualize, construct and document the artifact of the system-intensive process. It is not just a notation for drawing diagram, but a complete language for capturing knowledge regarding the subject for the purpose of communication. It has static, dynamic, environmental and organizal parts, and it based on object
Subsystem D and E specialized from the general subsystem C. subsystem B, C, D and E are in subsystem A. subsystem C depends on B Q3: - Write the note on the following? a. Class b. Object c. Use case d. Component e. Deployment Ans:-
a. Class: - A class is a way to bind the data and it’s associated functions together. It allows the data to be hidden, if necessary from external use. These are the description of set of objects with common structural features, behavioral features, relationships and semantics. This can be a description of any object in any system – information, technique, embedded real time, distributed, software and business.
-7-
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== b. Objects: - Objects are the basic runtime entities in an object-oriented system. These are the instance of classes and are used to model particular entities. They have a unique identity and may be referenced by a unique handle, which identifies and provides access to it. The canonical notation for an object is a rectangle with two compartments, top compartment containing the object name and other containing the list of attribute names and values.
Shape: rectangle Vertices = ((0,0),(0,4),(4,2),(2,0)) Backcolor = white Forecolor = Black
Use case: - The use case is unified modeling language, which is defined as a set of sequences of actions a system performs to yield as observable result of the values to someone or something which interacts with the system. The actions can involve communicating with a number of actors as well as performing calculations and work inside the system. d. Component: - The component is the implementation in the physical architecture of the concept and the functionality defined in the logical architecture. These are typically the implementation files in the logical architecture. A component is the distributable physical units, including source code, object code and executable code. A software component can be a source component, binary component or executable component. These are usually represented in UML by a rectangle with tow smaller rectangles to the left. The component name is written inside or below the large rectangle. c.
ABC
e.
Deployment: - A deployment focuses on the physical parts of the system such as the computers, devices, and the connection between them. This permits the consequences of distribution and resource allocation to e accessed.
-8-
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ========== ----------------------------------------------THE
END------------------------------------
-9-
P.T.O
B.Sc. IT 13(01 & 02) Object Oriented Analysis And Design ========================================= ==========
- 10 -
P.T.O