0% found this document useful (0 votes)
54 views136 pages

Toaz - Info Oosd Quantum Unit 2345 PR

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
54 views136 pages

Toaz - Info Oosd Quantum Unit 2345 PR

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
3 CONTENTS KCS-055 : MACHINE LEARNING TECHNIQUES UNIT-1 : INTRODUCTION (1-1 L to 1-22 L) ‘The meaning of Object Orientation, object identity, Encapsulation, information hiding, polymorphism, generosity, importance of modelling, principles of modelling, object oriented modelling, Introduction to UML, conceptual model of the UML, Architecture. UNIT-2 : BASIC STRUCTURAL MODELING (2-1 L to 2-33 L) Basic Structural Modeling: Classes, Relationships, common Mechanisms, and diagrams. Class & Object Diagrams: Terms, concepts, modelling techniques for Class & Object Diagrams. Collaboration Diagrams: Terms, Concepts, depicting a message, polymorphism in collaboration Diagrams, iterated messages, use of self in messages. Sequence Diagrams: Terms, concepts, depicting asynchronous messages with/without priority, call-back mechanism, broadcast messages. Basic Behavioural Modeling: Use cases, Use case Diagrams, Activity Diagrams, State Machine, Process and thread, Event and signals, Time diagram, interaction diagram, Package diagram. Architectural Modeling: Component, Deployment, Component diagrams and Deployment diagrams. UNIT-3 : OBJECT ORIENTED ANALYSIS (3-1 Lto3-21L) Object Oriented Analysis: Object oriented design, Object design, Combining three models, Designing algorithms, design optimization, Implementation of control, Adjustment of inheritance, Object representation, Physical packaging, Documenting design considerations. Structured analysis and structured design (SA/SD), Jackson Structured Development (JSD). Mapping object oriented concepts using non-object oriented language, Translating classes into data structures, Passing arguments to methods, Implementing inheritance, associations encapsulation. Object oriented programming style: reusability, extensibility, robustness, programming in the large. Procedural v/s OOP, Object oriented language features, Abstraction and Encapsulation, UNIT-4 : C++ BASICS & FUNCTIONS (4-1 L to 4-21 L) C++ Basics ; Overview, Program structure, namespace, identifiers, variables, constants, enum, operators, typecasting, control Ce Functions : Simple functions, Call and Return by reference, Inline functions, Macro Vs. Inline functions, Overloading of functions, default arguments, friend functions, virtual functions. Scanned wh ConScoma 2-3 L (CS/(T-Sem-5) Object Oriented System Design c ‘Architectural model can be defined as the blueprint of the entire system. @ Package diagram comes under architectural modeling. UML: Refer Q. 1.20, Page 1-191, Unit-1. [aeBa] What do you understand by architectural modeling ? Explain its various concepts and diagrams with suitable example. OR and diagrams. Architectural modeling : 1. Architectural modeling represents the overall framework of the system. 2. Itcontains both structural and behavioral elements of the system. 3. Architectural modeling can be defined as the blueprint of the entire system. Diagrams used in architectural modeling : 1. The two types of diagrams that give descriptions of the physical information about a system are deployment diagrams and component diagrams. 2. Deployment diagrams show the physical relationship between hardware and software in a system. 3. Component diagrams show the software components of a system and their relationships. 4, These relationships are called dependencies. A. Component diagrams : 1. The component diagrams are mainly used to model the static implementation view of a system, 2. ‘They represent a high-level packaged view of the code. 3. ‘They can be used to model executables, databases and adaptable systems. 4, Component diagrams mainly contain the following : i, Components : a. Acomponent is a physical, replaceable ofa system packages implementation sal proriten esa cess of interfaces, b, Acomponent is a physical manifestation of an object a well-defined interface and a set Wie i interface. «@ ‘A.complex system can bo built using software enhances re-use inthe system and failitates system evolution Object Oriented System Design 2-5 L (CS/AT-Sem-5) B. Deployment diagrams : They display the configuration of run- time processing elements and the software components, processes and objects. ‘The deployment diagram contains nodes and connections. Anode is apiece ofhardware in the system. A. connection depicts the communication path used by the hardware (Fig. 2.2.5). Communication ba er Que 2.3. | ‘What do you understand by classes in object oriented system design ? 1. The phrase class is use to refer to a group of similar things. 2. Aclass describes a group of objects with similar properties, common behavior, common relationships to other objects, and common semantics. 3. Objects in a class have the same attributes and behavior pattern. 4, Most objects derive their individuality from differences in their attribute values and relationships to other objects. 5. The objects in a class share a common semantic purpose, above and beyond the requirement of common attributes and behavior. 6. Each object “knows” its class. 7. Object-oriented programming languages can determine an object’s class at run time. 8. An object’s class is an implicit property of the object. GTA] explain relationship with its different types. Relationships : A model is not complete unless the relationships between elements are described properly. The Relationship gives a proper meaning to a UML model. Following are the different types of relationships used in 1. Dependency Notation : a, Dependency describes the dependent elements and the direction of dependency. Object Oriented System Design 2-7 (CS/IT-Sem-5) What do you mean by genera-ization ? Explain. How is it related with inheritance ? f OR Define aggregation and generalization. Explain. Generalization and specialization : Generalization and specialization represent a hierarchy of relationships between classes, where subclasses inherit from super-classes. 1. Generalization : i. Inthe generalization process, the common characteristics of classes are combined to form a class in a higher level of hierarchy, i.c., subclasses are combined to form a generalized super-class. ii It represents an “is - a - kind - of” relationship. For example, “car is akind of land vehicle”, or “ship is a kind of water vehicle”. 2. Specialization : i. Specialization is the reverse process of generalization. Here, the distinguishing features of groups of objects are used form specialized classes from existing classes. ii Itcanbe said that the subclasses are the specialized versions of the super-class. ‘The following figure shows an example of generalization and specialization. : a Land Water Air i [[ear Bus | [Ship] [ Boat | [Aeroplane] [Helicopter| Generalization Relation to inheritance : 1. Developers use the term generalization or inheritance to refer to the same concept of reusing shared attributes and operations that you show in a superclass and reuse in subclasses. 2. Generalization refers to the concept of generalizing from specifi subelasses) to the generic (the superelass). ae Object Oriented System Design 2-11 L (CS/AT-Sem-5) For example : 1, Aclassis away of grouping objects that share a number of characteristics: attributes (like name, color, height, weight, etc.) and behavior (such as ability to perform jumps, to run, to swim, ete.). All objects in the class horse will have an attribute named height, for example. That means that all object in that class have a height-the value of the attribute height will be different for each instance of the class (‘e., for each particular horse). A program for laying out a newspaper t Classes that you would expect in a program for newspaper layout include Page, Column, Line, Headline, and Paragraph. ii, Acatalog store order entry system : For a catalog store order entry system, classes include Customer, Order, Store, and Item. GERM] Give the general layout of a class diagram. Also prepare a class diagram for the instance diagram shown in the Fig. 2.9.1. Explain your multiplicity decisions. How does your diagram express the fact that points are in sequence ? Object Oriented System Design 2-13 L (CSAT-Sem-5) 1. | A class diagram is a schema,| An instance diagram describes pattern, or template for describing| how does a particular set of many possible instances of data. | object relates to each other. 2. |Acclass diagram describes the| An instance diagram describes general case in modeling al object instances. system. 3. | Aclass diagram describes object| An instance diagram is useful classes. for documenting test cases, especially scenarios, and is used to show examples to help to clarify a complex class diagram. 4, |The OMT symbol for a class is a| Figure below shows the OMT rectangular box with class name| representation of instance in boldface. A line is drawn| diagram. The class name in between the class name and] parenthesis is at the top of the attributes. object box in boldface and object P names are listed in normal font | with their attributes, B, ke of class diagram : Class diagram describes the attributes and operations ofa class and also the constraints imposed on the system. 2. ‘The class diagrams are widely used in the modeling of object- oriented systems because they are the only UML diagrams, which can be mapped directly with object-oriented languages. 8, Class diagram shows a collection of classes, interfaces, collaborations, and constraints, It is also known as a structural diagram. . Significance of instance diagram : 1, An object diagram represents an instance at a particular moment, which is concrete in nature, 2, It means the object diagram is closer to the actual system behaviour. 3. ‘The purpose is to capture the static view of a system at a particular Object Oriented System Design 2-15 L (CSAT-Sem-5) polymorphism is described using a collaboration diagram ? Explain using an example. OR What isa collaboration diagram ? How polymorphism is represented in a collaboration diagram? Explain with an example. Collaboration diagram : 1. Acollaboration diagram, also known as a communication diagram, is an illustration of the relationships and interactions among software objects in the Unified Modeling Language (UML). 2. These diagrams can be used to portray the dynamic behavior of a particular use case and define the role of each object. 3. Collaboration diagrams are created by first identifying the structural elements required to carry out the functionality of an interaction. Various terms used in collaboration diagram : 1. Objects : Objects are shown as rectangles with naming labels inside. The naming label follows the convention of object name; class name. 2 Actors: Actors are instances that invoke the interaction in the diagram. Each actor has a name and a role, with one actor initiating the entire use case. 8. Links: Links connect objects with actors and are depicted using a solid line between two elements. Each link is an instance where messages can be sent. Link 4, Messages : Messages between objects are shown as a labeled arrow placed near a link. These messages are communications between objects that convey information about the activity and can include the sequence - number. Polymorphism using collaboration diagram : 1. Fig. 2.12.1 uses a collaboration diagram to illustrate polymorphism in a business scenario. 2 ‘The diagram assumes that there are different ways of calculating an employee's pay. i w x: pane mage Object Oriented System Design 2-17 L (CSMIT-Sem-5) 2. Polymorphism is the ability of a message to be displayed in more than one form. 3, Itplays an important role in allowing objects having different internal structure to share the same external interface. Iterated messages : 4. Collaboration diagrams use syntax similar to sequence diagrams to indicate that either a message iterates (is run multiple times) or is run conditionally. 2. Wecanindicate that a particular message iterates by prefixing a message sequence number with an iteration expression. 3. We can simply use an asterisk (*) to indicate that a message runs more than once, or we can get more specific and show the number of times a message is repeated. ‘To indicate that a message is run conditionally, we can prefix the message sequence number with a conditional clause such as [x = true]. 5. This indicates that the message is sent only if the condition is met. 6 The UMLleaves the syntax of conditional clauses wide open, so we can create expressions that make sense in the context of our application. Use of self in message : 1. Selfrepresents the ability of an object to send a message to itself. 2. Messages in collaboration diagrams are shown as arrows pointing from the client object to the supplier object. 3. Messages represent a client invoking an operation on a supplier object. 4, Message icons have one or more messages associated with them. 5. Messages are eomposed of message text prefixed by a sequence number. 6. ‘This sequence number indicates the time-ordering of the message. Scant wih ConSconnar a | Object Oriented System Design 2-23 L (CSAT-Sem-5) aaa eae OR What do you understand by basic behavioural modeling ? BOIsTA, Maries Answer i, Behavioral models describe the internal dynamic aspects of an information system that supports the business processes in an organization. ii During analysis, behavioral models describe what the internal logic of the processes is without specifying how the processes are to be implemented. iii, In the design and implementation phases, the detailed design of the operations contained in the object is fully specified. iv. There are two types of behavioral models. First, there are behavioral models that are nsed to represent the underlying details of a business process portrayed by a use case model. In UML, interaction diagrams (sequence and communication) are used for this type of behavioral model, ¥. Second, there is a behavioral model that is used to represent the changes ees ip eupae pag ache: UML uses behavioral state machines vi. During the analysis phase, analysts use behavioral model to capture basic understanding ofthe dynamic nxpect of the underlying Business Object Oriented System Design 2-25 L (CS/IT-Sem-5) ‘Time diagram 1. Timing diagram is used to show interactions when a primary purpose of the diagram is about time. 2, It focuses on conditions changing within and among lifelines along @ linear time axis. 3. ‘Timing diagram is a special form of a sequence diagram. Utility of time diagram in system design : 1. Itemphasizes at that particular time when the message has been sent among objects. 2, Itexplains the time processing of an object in detail. 3. Itis employed with distributed and embedded systems. 4. Italso explains how an object undergoes changes in its form throughout its lifeline. 5. _Itdepicts a graphical representation of states of a lifeline per unit time. For example : State (Duration constraint i 3d) >| GEEZ] Define package. Explain the package diagram with suitable diagram. [ABU 201415, Marks 05] OR What are package diagrams and why are they used ? 1. Package diagrams are structural diagrams used to show the organization and arrangement of various model elements in the form of packages. A package is a group of elements (classes, associations, generalizations, and lesser packages) with a common theme, 3. A package partitions a model, making it easier to understand and manage, Large applications may require several tiers of packages. 4. Packages form a tree with increasing abstraction toward the root, which is the application, the top-level package, 5. As Fig 2.18.1 shows, the notation fora package is a box with atab. The purpose is to ; mageet the enclosed contents, ike a tabbed Object Oriented System Design 2-27 L (CSAT-Sem-5) wow e . l of use cases diagram in system design : ‘ “ pre cases identify the functionality of a system and organize it according to the perspective of users. 7 2, Use cases describe complete transactions and are therefore less likely to omit necessary steps. ; 3. The main purpose of a system is almost always found in the use cases, with requirements lists supplying additional implementation constraints. Gaeaa0| What do you mean by activity diagram ? Explain in detail. oR What do you mean by activity diagram ? What are the two special states shown in an activity diagram ? Explain with an example. 1. Amactivity diagram isa flowchart that shows activities performed by a system. 2, ‘The two special states shown in an activity diagram are the Initial State (Start Point) and Final State (End Point). 3 Initial State or Start Point : A small filled circle followed by an arrow represents the initial action state or the start point for any activity diagram. Start Point/Initial State 4. Final State or End Point : An arrow pointing to a filled circle nested inside another cirele represents the final action state. a Ent Point Symbol For example : HEEBBBEB) vetine state machine? Draw a state machine diagram trmevvogs ephone lt ROHS State machine : A state machine diagram models Si vate the behaviour ofa si object, specifying the sequence of event single iteietime f ts that an object goes through object Oriented System Design 2-29 L (CS/MIT-Sem-5) What do you mean by event ? What are the types of cvoatexplain with example? (ARISTA) 1, Anevent is something that happens at a point in time, such as user presses right mouse button. An event is a one-way transmission of information from one object to another. An event conveys information from one object to another. 2, An event has no duration. By definition, an event happens instantaneously with regard to time scale of an application. 3, Following are three most common events A. Signal event : 1. Asignal event is the event of sending or receiving a signal. 2. Asignal is a one-way transmission of information from one object to another. 3. Asignal is a message between objects while a signal event is an occurrence in time. For example, TrainDeparture has attributes train, trainNumber, city, and date. The UML notation is the keyword signal in guillements (<< >>) above the signal class name in the top section of a box. The bottom section lists the signal attributes. train trainNumber B. Time event: 1. A time event is an event caused by the occurrence of an absolute time or the elapse of a time interval. 2. For example, Fig. 2.22.2 shows, the UML notation for an absolute time is the keyword when followed by a parenthesized expression involving time. The notation for time interval is the keyword a/ter followed by a parenthesized expression that evaluates to atime duration, Object Oriented System Design 2-81 L(CS/T-Sem-5) EE @ Make repairs : A repair technician performs the unexpected service on the vending machine necessary to repair a problem inits operation. ® Load items: A stock clerk adds items into the vending machine to replenish its stock of beverages. Use case diagrams are divided as: 1. Use case diagram are divided into three use cases diagrams i.e., Order, SpecialOrder, NormalOrder and one actor which is the customer. 2. The SpecialOrder and NormalOrder use cases are extended from Order use case. 3. Hence, they have extended relationship. 4. The actor Customer lies outside the system as it is an external user of the system. queza| Describe in brief component diagram. L Coeresee Seared ‘The component diagrams are mainly used to model the static implementation view of a system, 2. They represent a high-level packaged view of the code, 3. They can be used to model executables, databases and adaptable Component diagrams mainly contain the following Components + Scanned wih ConSconmar g-4L (CSAT-Sem-5) Object Oriented Analysis p. Flexibility : Flexibility determines whether the chosen algorithm | can be implemented suitably, without loss of appropriateness in various environments. ¢. Understandability : This determines whether the chosen algorithm. is easy to understand and implement. ques, | What are object oriented model ? Explain. Answer — 1.13, Page 1-121, Unit-1. 35. | What are the three models in OMT ? How is the object = Pao net rete esti OMT? Explain with an example. Following are the three models in OMT: 1. Object model: a, Object model encompasses the principles of abstraction, encapsulation, modularity, hierarchy, typing, concurrency and persistence. b. Object model emphasizes on the object and class. Main concepts related with object model are classes and their association with attributes. d Predefined relationships in object model are aggregation and generalization (multiple inheritance). 2 Dynamic model: a. Dynamic model involves states, events and state diagram (transition diagram) on the model. b. Main concepts related with dynamic model are states, transition between states and events to trigger the transitions. ¢. Predefined relationships in object model are aggregation (concurrency) and generalization. 3 Functional model : a. Functional Model focuses on the how data is flowing, where data is stored and different processes. b. Main concepts involved in functional model are data, data flow, data store, process and actors. & unelinga pode deserved She WSR OASRORER ELROD "it the help of data flow diagram (DFD). employees who speak Japanese. ques. | Describe implementation of control in object oriented The object designer may incorporate refinements in the strategy of the state-chart model. In system design, a basic strategy for realizing the dynamic model is made. During object design, this strategy is aptly embellished for appropriate implementation. 2, The approaches for implementation of the dynamic model are : a. Represent state as a location within a program : i. This is the traditional procedure-driven approach whereby the location of control defines the program state. ii A finite state machine can be implemented as a program. iii A transition forms an input statement, the main control path ee the sequence of instructions, the branches form the conditions, and the backward pat! Epi paths form the loops or b. State machine engine: i This approach dire! i . sate ne ce ay represents astate machine througha ii, is class executes the state machine thro ars fe ti ugh a set of © Control pepe eeedoannrae ke. d by the application. + In this approach, an object is implemented as a task in the iii Tt preserves inhers ent concurrency of real sbject . Weis] What do you mean by object representation ? gsL(CSMIT-Sem-5) Object Oriented Analysis Static Models : To describe the static structure of a system using class ® ‘siagrams and object diagrams. ‘ Models : To describe the dynamic structure of a system and show the interaction between classes using interaction diagrams and state-chart diagrams. queti0.| Describe physical packaging with example. Physical packaging : 1. A component is a physical and replaceable part of the system that conforms and provides the realization of a set of interfaces. 9, It represents the physical packaging of elements like classes and interfaces. 3, Apackage is an organized group of elements. A package may contain structural things like classes, components, and other packages in it. 4, Forexample, a package is represented by a tabbed folder. A package is generally drawn with only its name. However, it may have additional details about the contents of the package. Customer + Personal_details + Account_details + Loan_details QaeTAT| what are the different aspects of packaging ? Eee Answer — The different aspects of packaging are : 1 Hiding internal information from outside view : It allows a class to be viewed as a "black box" and permits class implementation to be changed without requiring any clients of the class to modify code. 2 Coherence of elements : a. Anelement, such as a class, an operation, or a module, is coherent ifit is organized on a consistent plan and all its parts are intrinsically related so that they serve a common goal. & Construction of physical modules : The following guidelines help while constructing physical modules : -10L (CSAT-Sem-5) Object Oriented Analysis a Make them public ; a. The documentation of the processes must be available to all team and company members. b. Restricting access to documentation creates the false illusion that it’s only relevant to a particular group. 4. Flexible documentation : a, Companies change, update, improve, so their processes are also subject to constant changes. To improve the effectiveness of the process, incorporate the necessary adjustments to the documentation of the process, b. Document the date of the last update. ¢, Save a backup copy of the files that document the process. d. Review the documents at least once a year. Que 38. | What do you mean by multiple inheritances ? Explain it with an example. Can you implement multiple inheritances in Java? Answer | Multiple inheritance : 1. Multiple inheritance is a feature of object-oriented computer programming languages in which an object or class can inherit characteristics and features from more than one parent object or parent class, 2. When one class extends more than one classes then this is called multiple inheritance. For example : Class C extends class A and B then this type of inheritance is known as multiple inheritance. [B] Nsltiple inheritance in Java: Java does not allow multiple inheritance, and we cannot extend more ‘one other class. vadoosnt allow multiple inheritance to avoid the ambiguity caused by peru Moda + FF 3-11 L(CSAT-Sem-5) nies Oriented System DOREY GBT porte documenting design considerations How do weperform adjustment ofinheritance* [00 Maa 0) design Following kinds of adjustments can be used to increase the chance of inheritance : L considerations : Refer Q. 3.12, Page 3-9L, Unit-3. ‘Some operations may have fewer arguments than others. The missing arguments can be added but ignored, For example, a draw operation on ‘a monochromatic display does not need a color parameter, but the parameter can be accepted and ignored for consistency with color displays. Similar attributes in different classes may have different names. Give the attributes the same name and move them to the common ancestor class. Then operations that access the attributes will match better. ‘Some operations may have fewer arguments because they are special cases of more general arguments. Implement the special operations by calling the general operation with appropriate parameter values. Opportunities to use inheritance are not always recognized during the analysis phase of development, so it is worthwhile to reexamine the object model looking for commonality between classes. pa LiCSME Sen’ _ sn vese asoi structured analysis and structured design (SA/SD) with oat [ART mis 8) =. and structure design : 1, Structured Analysis and Structured Design (SA/SD) is diagrammatic notation which is design to help people understand the system. 2, The basic goal of SA/SD is to improve quality and reduce the risk of system failure. Itestablishes concrete management specification and documentation. Iéfocuses on solidity, pliability and maintainability of system. ‘The approach of SA/SD is based on the Data Flow Diagram. Itis easy to understand SA/SD but it focuses on well defined system poundary whereas JSD approach is too complex and does not have any graphical representation. a 1. SSD is combined known as SAD and it mainly focuses on following three points : a. System b. Process ©. Technology 8. SA/SD involves two phases : a. Analysis Phase : It uses Data Flow Diagram, Data Dictionary, | State Transition diagram and ER diagram. | b. Design Phase : It uses Structure Chart and Pseudo Code. For example : i. During structured design, data flow diagram processes are grouped into tasks and allocated to operating system processes. and CPUs. ii Data flow diagram processes are converted into programming language functions, and a structure chart is created showing the Procedure call tree. Compare the OMT methodology with SA/SD methodology. Explain with suitable example. p14 L (CSMT-Sem-5) Object Oriented Analysis 1 Specification phase : This phase focuses on actually what is to be done. Major goal is to map progress in the real world on progress i the system that models it. _ c. Implementation phase : i. Inthe implementation phase JSD determi i the required functionality. vies ii Implementation way of the system is based on transformation of specification into efficient set of processes, Geos] How do you map the object-oriented concepts using non-object oriented languages ? Explain with an example. [AKIO ao10an OR How object-oriented concept can be implemented using non-object- oriented language? Explain with an example. Answ Implementing an object-oriented concept in a non-object oriented language requires the following steps : 1. Translate classes into data structures : i, Each class is implemented as a single contiguous block of attributes. Each attribute contains variable. Now an object has state and identity and is subject to side effects. ii Avariable that identifies an object must therefore be implemented as a sharable reference. 2 Pass arguments to methods : i. Every method has at least one argument. In a non-object-oriented language, the argument must be made explicit. ii, Methods can contain additional objects as arguments. In passing an object as an argument to a method, a reference to the object must be passed if the value of the object can be updated within the method, 3. Allocate storage for objects: i Objects can be allocated statically, dynamically or on a stack. i, Most temporary and intermediate objects are implemented as stack- based variables. iii, Dynamically allocated objects are used when there number is not known at compile time. iv. A general object can be implemented as a data structure allocated on request at run time from a heap. soi (CST-Sem-5) Object Oriented Analysis ee Class definitions The first step in implementing an object-oriented design isto declare object classes. Each attribute and operation in ee must be declared as part of its corresponding class. ii, Assign data types to attributes. Declare attributes and i as either public or private. oreaeree 2, Creating objects : i, Object-oriented languages create new objects in following two ways : a, Class operation applied to a class object creates a new object of the class. b. Using special operations that create new objects. ii When anew objectis created, the language allocates storage for its attribute values and assigns it a unique object ID. 3 Calling operations : i, _Inmost object-oriented languages, each operation has at least one implicit argument, the target object, indicated with a special syntax. ii Operations may or may not have additional arguments. 4 Using Inheritance : i. Toimplement inheritance object-oriented languages use different mechanisms. ii, There are three independent dimensions for classifying inheritance mechanisms : a. Staticor dynamic b. Implicit or explicit ©. Per object or per group. iii Many of the popular languages are static, implicit and per group. 5. Implementing associations : i There are two approaches to implement associations : buried pointers and distinct association objects. ’ ii, Ifthe language does not explicitly support association objects then buried pointers are easy to implement. iii oreo com ale: be pesos a a a ne ee onan eee Somer] There are different ways in which parameter data can be passed into ‘nd out of methods and functions. 7 2 Let ame ete eal 0 is ca con’ and B is called the “called Ranetion or callee function”. to Bare called actual arguments and the arguments which A sends a pars nr B are ealled formal arguments. 4, Following are the types of parameters + ; a Vormal parameter: variable and its type as they appear in the prototype of the function or method. Syntax: function_name(datatype variable_name) : b. Actual parameter : The variable or expression corresponding toa formal parameter that appearsin the function or method call in the calling environment. Syntax : fune_name(variable name(s)); THSGAIT] Describe implementation of inheritance with example. 1. Inheritance is the sharing of attributes and operations among classes basedon a hierarchical relationship. 2. Object-oriented languages provide support for i i Pirie strong support for implementation 3. Inheritance has become synonymous with code reuse within »bject- oriented programming community. a ee 4. After modeling a system, the develo m ystem, per looks at the resulting classes - and tries to group similar classes together and reuse ee code. Often code is available from past work (such. library) whi Sereoper can rouse and nucly tf Od th ConSconmar CSMT-Sem-5) Object Ori ha jv, There should be separate policy and implementation. y, Provide uniform average. yi, Broaden the method as much as possible. i, Avoid global information. vill. Avoid modes. 1, A method is robust if it does not fail even if it receives improper parameters. 2, Robustness against internal bugs may be traded off against efficiency. 3, Robustness against user errors should never be sacrificed. 4, Rules for robustness : a. Protect against errors : Software should protect itself against incorrect user input. Incorrect user input should never cause a crash. b, Optimize after the program runs : Don’t optimize a program until you get it working. ¢. Validate arguments : External operations, those available to users of the class, must rigorously check their arguments to prevent failure. Don’t include arguments that cannot be validated. d. Avoid predefined limits : When possible use dynamic memory allocation to create data structures that do not have predefined limits. ©. Instrument the program for debugging and performance monitoring : You should instrument your code for debugging, statisties, and performance. The level of debugging that you must build into your code depends on the programming environment presented by the language. iii, Extensibility : Extensibility is a software engineering and systems design principle that provides for future growth. Extensibility is a measure of the ability to extend a system and the level of effort required to implement the extension. Extensions can be through the addition of new functionality or through modification of existing functionality. The principle provides for enhancements without impairing existing ae functions. a ‘or example : Object-oriented application framework which achieve jy, Mensibility typically by using inheritance and dynamic binding. A Abstraction is the selective examination of certain aspects ofa problem. ‘The goal of abstraction is to isolate those aspects that are important for Some purpose and suppress those aspects that are _ «t Oriented System Design 4-3L (CS/IIT-Sem-5) rau program that uses the class is placed in a third file which rc ie the previous two files as well as any other files required. Include files Class declaration Member functions definitions Main funetion program Describe briefly the term namespace, identifiers, variables constants, enum. A. Namespace : Namespace defines a scope for the identifiers that are used in a program. 2 Forusing the identifiers defined in the namespace scope we must include the using directive : using namespace std; Here, std is the namespace where standard class libraries are defined. This directive will bring all the identifiers defined in std to the current global scope. Identifiers : Identifiers refer to the names of variables, functions, arrays, classes, ete., which are created by the programmer. ‘They are the fundamental requirement of any language. Each language has its own rules for naming these identifiers. Following are the rules for C++ = 4 Only alphabetic characters, digits and underscores are permitted. b. The name cannot start with a digit. © Uppercase and lowerease letters are distinct. 4 A declared keyword cannot be used as a variable name. Constants : Constants refer to fixed values that do not change during the execution ota program. 1 Tie icldentgor, characters, oatng pint numbers and strings ‘al constant do not have memory locations. = rp A oN object Oriented System Design 4-71 (CSITT-Sem-5) Implicit conversion : Implicit: conversions do not require any operator, ‘They are automatically performed when a value is copied to a compatible type. i, For example: short a = 2000; int; b=a; pb. Explicit conversion : i, Manyconversions, especially those that imply a different interpretation of the value, require an explicit conversion. ii Forexample: short a = 2000; int; b=(int)a; //C like cast notation b=int(a);_// functional notation c. Dynamic cast : i dynamic cast can be used only with pointers and references to objects. ii Its purpose is to ensure that the result of the type conversion is a valid complete object of the requested class. @ Static cast : static_cast can perform conversions between pointers to related classes, not only from the derived class to its base, but also from a base class to its derived, © reinterpret_cast : reinterpret_cast converts any pointer type to any other pointer type, even of unrelated classes, ‘The operation result is a simple binary copy of the value from one Pointer to the other. const_cast : This type of casting manipulates the constness of an. object, either to be set or to be removed, & typeid: typeid allows to check the type of an expression : typeid (expression) This operator returns a reference to a constant object of type type_info that is defined in the standard header file . BERT Describe various control statements used in Cr+. i ea wen] Explain the prototype of main() function, 1, The main() returns a value of type int to the operating system, 2, C++ explicitly defines main() as matching one of the following prototypes : int main(); int main(int arge, char * argy(]); 3. The functions that have a return value should use the return statement. for termination. 4, Hence the main() function in C++ is defined as follows : int main() 5. Since the return type of functions is int by default, the keyword int in the main() header is optional. 6 Most C++ compilers will generate an error or warning if there is no return statement. REETAID] Describe call by reference and return by reference with 1 Call by reference : Provision ofthe reference variables in ++ permits ua to pest BAFBDieT? _ to the functions by reference. ——_ “Tae mevpase anaes ane acta arguments Scanned wih ConSconar Oriented System Design ject 421 L (CSAT-Sem-5) tt can be declared either in the private or the public part, mel Describe virtual function, Avirtual function is a member function which i de ith "class and is redefined (Overridden) by a rived cage pitied) When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class's version of the function. 3 Virtual functions ensure that the correct function is called for an object, regardless of the type of reference (or pointer) used for function call. 4, They are mainly used to achieve Runtime polymorphism §, Functions are declared with a virtual keyword in base class. 6. The resolving of function call is done at Run-time. || What are the rules used for a virtual function ? 1 Virtual functions cannot be static and also cannot be a friend function of another class. 2. Virtual functions should be accessed using pointer or reference of base class type to achieve run time polymorphism. 4. ‘The prototype of virtual functions should be same in base as well as derived class, {They are always defined in base class and overridden in derived class. It 's not mandatory for derived class to override (or re-define the virtual ‘unction), in that ease base class version of functions used. A class may have virtual destructor but it cannot have a virtual Constructor, ©99 wet | Write short note on object and classes. A. Object: 1. An Object is an instance of a Class. When a class is defined, no memory isallocated but when it is instantiated (i.e. an object is created) memory isallocated. 2 Whena class is defined, only the specification for the object is defined; nomemory or storage is allocated. To use the data and access functions defined in the class, you need to create objects. B. Classes : L Adlass is a way to bind the data and its associated functions together. It allows the data (and functions) to be hidden, if necessary, from external use, 2 When defining a class, we are creating a new abstract data type that can be treated like any other built-in data type. ‘The class declaration describes the type and scope of its members. 4 The class function definitions describe how the class functions are implemented. The general form of a class declaration is : gy class_name h function Object Oriented Syston Design n is similar to ct declaration, The what follows is an abstract data of type classy," enclosed within braces and terminated jy a class declara' ae es that 7. The body of a class is semicolon. ea ‘Theclass body contains the declaration of variates and functions : bles are collectively called class members, These functions and varial 9, The class members that have been declared as private can be a only from within the class. ‘While the public members ean be accessed from outside the class also Phe variables declared inside the class are known as data membe the functions are known as member functions. = etz | Design a class using C++ to create a singly linked list, Fincludeciostream> using. namespace std; struct node { int date; pode *next; i class list : 5-5L (CSIT-Sem-5) bli : . void update(void); void write(void); }; 4, Ifstis an object of sample, * shread0; 1 won't wo then ik; objects cannot access 1) private members isillegal. 5. However, the update the value of m. void sample :: update(void) { read(); } fanction read) can be called by the function update() to 1! simple call; no object used Que A | Differentiate between public and private member 1. [All the elass members declared under public will be available to everyone. ‘The class members declared as private can be accessed only by the functions inside the class. The data members and member functions declared public can be accessed by other classes too, Only the member functions or the friend functions are allowed to access the private data members ofaclass, The public members of a class sage econsed from anywhere ant Program using the direct er aeCeSs Operator (,) wi the object of that clans itt They are not allowed to be accessed directly hy any object or function outside the class. out oriented System Design 8Q-3 L (Csi. es actor is an active object that dri : Sem-5) ducing or consuming values, Acre acg alae flow fa by and outputs of a data flow graph.. iched to the inputs 4 What is object-oriented modeling? - sct-oriented modeling (OOM) is th z a collection of objects that contain oe AEE orice using variables found within an object. ies of the instance 115, What are the steps involved in object-oriented modeling? Ans. Following are the steps involved in object-ori . 1. System analysis object-oriented modeling: 2, System design 3, Object design 4, Final implementation 116, Define the term link and association. 485 Link : Link defines the relationship between two or more objects anda link is considered as an instance of an association. ‘Association : It is a group of Jinks that relates objects from the same classes. 117. What do you mean by UML? OR What is unified markup language 2 tis apictoral an "8% UML stands A sed for Unified Modeling tomake software blueprints. be described a8 & purpose visual modeling langues? to visualize, specif and document software syste™ S @o9 2 Marks Questions Basic Structural Modeling (2 Marks Questions) What are different types of structural modeling in object ited design? nab canes i Se te is epe of structural modeling in object oriented system design: Structural modeling Behavioural modeling Architectural modeling Define structural modeling. Structural modeling captures the static features of a system. Structural model represents the framework for the system and this framework is the place where all other components exist. 21. cd 1 2. 3. 22. a= Define Behavioral Model. Behavioral model describes the interaction in the system. It represents the interaction among the structural diagrams. Behavioral modeling shows the dynamic nature of the system. Re i t does an architectural model represent ? : ct ae overall framework of the system. contains and behavioral elements of the syste™- aa pate the diagrams used in architectural modeling. system in area eTiBtions ofthe physical information about ¢ component diagrams, modeling are deployment diagrams rs 26, ‘sent = Deployment diagr t diagrams and component diagram. relationship berae®: Deployment diagrams show the Component ice wee hardware and software in a syste components of 1a ant dingrane shaw the mG al of Define the term interface, "set of interfaces, = Aninterface is a collection of, service of a class or a compo; 28. operations ment. Its reposeregt —— ‘acircle, 29. What are the different types of notation nce UML, Following are the different t; ; WE Jependency Notation" °F Metation used in UM; 9, Association notation 3, Generalization notation 4, Extensibility notation 210, Define association and generalization notation. ans Association Notation : Association describes how the elements i UML diagram are associated. it describes how hy meth . taking part in an interaction, e Generalization notation : Generalization describes the inheritance relationship of the object-oriented world. It is a parent and child relationship. 210. What are the mechanism that provide extensibility feature? ang Following mechanisms to provide extensibility features : i. Stereotypes (Represents new elements) ii. Tagged values (Represents new attributes) iii. Constraints (Represents the boundaries). 211 Which notation is used to enhance the power of language. ‘Sik Extensibility notation is used to enhance the power of a language. 212. Define class diagram. ME Class diagram isa static diagram that repress an application, Class diagram is used for visualizing, a documenting different aspects ofa system and ‘also for constructing executable code of the software application. staticview of Loree au diagram? diagram, [leben aug ctrl net isan ilutratan of the flan ag tangue OM Scanned wh ConScomar oriented System Design SQ71 (esa. pms the aaehnistion fcmmaree eee concurrent activities, 1 sometimes one object must concurrently. 2. The object does not synchronize the int ternal steps tes but must complete both activities before itean SEAM state. 4, For example, a cash dispensing machine dispenses cash the user’s card at the end of a transaction, The De ee reset itself until the user takes both th e cash and the card, user may take them in either order or even tulluitiagaty- a Perform two (or more) activities a1, What is nested state diagram ? Explain with suitable example. = 1. Anested state diagram is used to model the complex system as the regular state diagram is inadequate in describing the large and complex problem. 2 The nested state diagram is the concept of advanced state modeling. For example: Fig, 2. Nested stage diagram of car transmission. ; L There are three states inside CarTransmission state diagram Teverse, neutral and forward. Among these three states, the forward state has three nested ‘States i.e, First, Second and Third. ite state, selecting N Atany nested state of Forward gear neutral state 4, Nould transit the corresponding state t0 the transit you to the Being in a neutral state, selecting F would forward state, cz rbot? Tt is a run- time process. The method definition and method call are linked during the run time, What are the stages used in design optimization ? Design optimization involves the following stages : What is a documentation ? Documentation is a software development process that records the procedure of making the patrahen seis sign decisions need to be documented for any non-trivial software oe for transmitting the design to others. What is structured analysis and design phase ? Structured Analysis and Structured Design (SA/SD) is diagrammatic notation which iz derign to help people understand the system. The basic goal of SA/SD is to improve quality and reduce the risk of system failure. What are the phases of SA/SD ? ‘SA/SD involves two phases : Analysis : Tt uses Dé ‘Transition 4 J OuER Ae Data Dione, State Design Phase : Tt uses Structure Chart and Pseudo Code. sate ekson system development, 5 development thar thar oonaelgpment (IS JSD) is @ method of gorn gree ewe in ih aap inigo oyieab el tt¥ F meee Ot ..Ns 2 Marks Questions C++ Basics & Functions (2 Marks Questions) fiers. |. Define the term namespace and identi ae a Nincipac! : Namespace defines a scope for the identifiers that sed in a program. ; Identifiers: Identifiers refer to the names of variables, functions, arrays, classes, etc. created by the programmer. 4.2. What is a constants ? aus Constants refer to fixed values that do not change during the execution ofa program. They include integers, characters, floating point numbers and strings. Define the term enumerated and variables. ‘us: Enumerated : An enum specifier defines the set of all names that will be permissible values of the type. These permissible values are called members. Variables : A variable is a symbolic name that can be given @ variety of values. Variables are stored in particular places in the computer's memory, What are the different operators used in C++? Different operators used in C4-+ are: ‘mory management operator Manipulators bs ‘Typecast operators What do you mean by typecast? peat an expression of a given type into another type is know” What are the different i types of ? Different types of typecast are ‘ypecas Explicit typecast en - - Solved Paper (2011. B.Tech, aa (SEM. V) ODD SEMESTER Tha ORY EXAMINATION, 2011-12 OBJECT ORIENTED TECHNIQUES Note: Attempt all questions. 1, Attempt any fwo parts : (2x 10=20) ai, What do you understand by object-oriented technology ? Discuss the pros and cons of object-oriented technology with suitable example. Refer Q. 1.7, Page 1-6L, Unit-1. ii, Differentiate between aclass and object with some example. Also prepare a list of objects that you would expect each of the following systems to handle : (1) a program for laying out a newspaper, (2) a catalog store order entry system. Refer Q. 2.8, Page 2-10L, Unit-2. i, What do you mean by modeling ? Discuss several purposes served by models with suitable examples. tie Refer Q. 1.12, Page 1-11L, Unit-1. i, What do you mean by generalization ? Explain. How is it related with inheritance ? ‘AUK Refer Q. 2.5, Page 2-6L, Unit-2. model i, What do you mean by UML? Discuss the eoneopteal of UML with the help of an appropriate exam! NUK Refer Q. 1.20, Page 1-191, Unit-1. i of the iL Wire is used in the following applications. For ene following ti prepare a list of wire istic that are relevant and also explain WHY on ment he electrical system for a” NW Refer Q. 1.19, Page 1-181, Unit-l. SP-7 L (CS/AT-Sem-5) . Design Object Oriented System Desi (10« any two parts ! F ob Se teat mint D e Sool apres decisions. How does your diagram 7 mone The fact that points are in sequence Fig. 1. Refer Q. 2.9, Page 2-11L, Unit-2. i. What is a collaboration diagram ? How polymorphism is represented in a collaboration diagram? Explain with an example. Refer Q. 2.12, Page 2-14L, Unit-2. What do you mean by sequence diagram? Explain various terms and symbols used in a sequence diagram. Describe the following using sequence diagram : (i) asynchronous messages with/without priority. (ii) broadcast messages. Refer Q. 2.14, Page 2-171, Unit-2. diagrams, (2) Basic behavioural modeling. Component diagrams : Refer Q. 2.24, Page 2-31L, Unit-2. Basic behavioural modeling: Refor Q. 2.16, Page 2-23L, Unit-2. Prepare a portion of an diagram for a library book checkout system that shows the date a book is due nad the for an overdue book as derived objects. Refer Q. 2.11, Page 2-141, Unit-2, an BaTTer any two parte : 10x2=20) a Explain each of the following with in reference to abject hs Roveabilig amming style with an example: Discuss in brief the following terms : (1) Component (csitT-Sem-5) Solveap , Robustness (2011-19) és Extensibility , ive | gos. Refer Q. 3.23, Page 3-19L, Unit-3, pi. How object-oriented concept can be im, object-oriented language? Explain wint musing non. gon, Refer Q. 3.18, Page 3-141, Unit-3, an example, ji, What do you mean by documentation? considerations in documentation diagaeonees cao gas: Refer Q. 3.12, Page 3-9L, Unit-3. ras ¢. Write short notes on the following : i, Jackson Structured Development (JSD). ans Refer Q. 3.17, Page 3-131, Unit-3. ii, Dynamic modeling and Functional modeling. ama Refer Q. 3.13, Page 3-10L, Unit-3. 4, Answer any two parts : (10x2=20) ai, Why Java is known as a platform independent language? Discuss the advantages and disadvantages of a platform independent language. Also give various data types in Java. ‘is This question is out of syllabus from session 2020-21. ii, How polymorphism is handled in Java? Explain with some suitable example using Java programming language. AES This question is out of syllabus from session 2020-21. __ bi, Write a program in Java to count display the semen | vowels in a given sentence of a at least 35 chars ee ii, Design class using Java to represent a stude’ Ct having the following attributes and methods :( ) eat. 1D, of the student Institute are as follows | Snr, Student_Name, Student_Address, Birth er Enrollment_Year; (ii) The methods are aad net the intial values to all attributes, 10 ad@ 8 A year of record, display the list of students for enrollment and course. 1 21, AME This question is out of syllabus from session a brief: md with suitable exam using Javain ii, Boterprise Java Beans Java APP's sion 2020-21. This question is out of syllabus from #28 12L (CSAT-Sem-5) Solved Paper (2012-13) Refer Q. 3.7, Page 3-61, Unit-8, Describe the structured analysis and structured design approach with an example. Ua Refer Q. 3.15, Page 3-11L, Unit-3, Write short notes on the following : Compare procedural programming with object-oriented ing with examples. Refer Q. 1.6, Page 1-5L, Unit-1, Write a short note on Jackson Structured Development (JSD). Refer Q. 3.17, Page 3-13L, Unit-3. Answer any two parts : (2x 10=20) What is the significance of data types in a programming language ? Describe the various data types used in Java. Also compare C++ and Java. This question is out of syllabus from session 2020-21. i. Write a program in java to display the longest word in a given sentence of at least having 9 words. i. Design a class using Java to create a singly linked list. Then also write the methods for adding a node to the linked list in the beginning and also to search a given node. This question is out of syllabus from session 2020-21. Write in short on the following with suitable example in Java and explaining their significance : Session beans and Entity beans. Jave APIs ‘This question is out of syllabus from session 2020-21. connectivity ? Tien the Zeunectivity model Also dieeas SDBG te ated with an example. This question is out of syllabus from session 2020-21, Write applets to draw the following figures with proper + A square inside another square. ‘This question is out of syllabus from session 2020-21, Object Oriented System Design SP-151L (CS/T-Sem-5) ce. Explain sequence diagrams with example. AEE Refer Q. 2.14, Page 2-17L, Unit-2. a What do you understand by callback mechanisms ? AME Refer Q. 2.15, Page 2-211, Unit-2. What do you understand by basic behavioural modeling ? Refer Q. 2.16, Page 2-231, Unit-2. e An £& What are package diagrams and why are they used ? AME Refer Q. 2.18, Page 2-251, Unit-2. 3% a Attempt any two parts : (10x 2=20) What are the three models in OMT ? How is the object oriented analysis and design attached with OMT ? Explain with an example. Refer Q. 3.5, Page 3-4L, Unit-3. = b. Describe documenting design considerations. How do we perform adjustment of inheritance ? BBE Refer Q. 3.14, Page 3-11L, Unit-3. © i Ane Write short notes on: SA/SD and JSD SA/SD : Refer Q. 3.15, Page 3-11L, Unit-3. JSD : Refer Q. 3.17, Page 3-13L, Unit-3. ii, Procedural v/s OOP. REE Refer Q 1.6, Page 1-6L, Unit-1, 4 Attempt any two questions ; i i * * ae class, adava for Employee class where salary is an abstract erry yy estiol il REE This question is out of syllabus from session 2020-21. b Explain Multithreading in Java, What is the effect in Program when we use multithreading {Java program fors sin (=) + 00a Q) ualng tWrite ‘This question is out of syllabus from session 2020-21. . Write short notes on; i, Event Handing , ii, EJB a a Furnace relay [temp < target temp ‘and season switch in Heat] [temp > target temp +d or season switch in Heat] Air conditioner relay [temp target temp-d or season switch not in Cool] Fig. 1. 5. What doyou mean by object modeli , ing technique ? Explain. Discuss the various stages of the obicet modeling techniques with some example. Refer Q. 1.18, Page 1-17L, Unit-1, 6 What do fora phone call.” : a | syste is @ sequence of actions that takes place within the ‘The starting poi point POiDt is stimulus from an external source andthe ene ‘ogical termination of a particular sequene- Enchofthe tres genome eal is depicted in Fig. 2 Vertical fine Caller, Phone Line, and Callee, is show? betw _ Connecting the ante Obiects are shown with horizontal lines by Scenarios ? Prepare an event trace ae.) ff

You might also like