0% found this document useful (0 votes)
50 views66 pages

Oosd Quantum Notes

Notes for students

Uploaded by

Arjun Singh Pal
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)
50 views66 pages

Oosd Quantum Notes

Notes for students

Uploaded by

Arjun Singh Pal
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
You are on page 1/ 66
semester-5 ~ CS ait... * Topic-wise coverage of entire syllabus _in Question-Answer form. * Short Questions (2 Marks) Includes solution of following AKTU Questi ion Pa PTS rh Pee eS os i UNIT-1 : INTRODUCTION (1-1 LL 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 Lto 3-21 L) 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 structures. C++ Functions : Simple functions, Call and Return by reference, Inline functions, Macro Vs. Inline functions, Overloading of functions, default arguments, friend functions, virtual functions. lear ede UNIT-5 : OBJECTS AND CLASSES (5-1 Lto 5-191) ‘Objects and Classes : Basics of object and class in C++, Private and public members, static data and function members, constructors and their types, destructors, operator overloading, type conversion. Inheritance : Cancept of Inheritance, types of inheritance: single, multiple, ‘multilevel, hierarchical, hybrid, protected members, overriding, virtual base class. Polymorphism : Pointers in C++, Pointers and Objects, this pointer, virtual and pure virtual functions, Implementing polymorphism. SHORT QUESTIONS (SQ-1L to SQ-15 L) ‘SOLVED PAPERS (2010-11 TO 2015-16) (SP-1 L to SP.25 L) Introduction CONTENTS Part-1 : Introduction, The Meaning of Object Orientation, Object Identity, Encapsulation, Information Hiding, Polymorphism, Generosity ». 1-21 to 1-11 Part-2 Importance of Modelling, Principles of Modelling, Object-oriented Modelling I-LIL to 1-191, P 2 Introduction of UML, 1-191 to 1-221, Conceptual Model of UME, Architecture Lee SoS ae 1-2L (CSTT-Sem-5) Introduction, The Meaning of Object Orientation, Object Identity, Encapsulation, Information Hiding, Polymorphism, Generosity. Introduction Questions: Answers Long Answer Type and Medium Answer Type Questions Que Li. | Explain object-oriented approach with its benefits. Answer 1. Inthe object-oriented approach, the focus is on capturing the structure and behavior of information systems into small modules that combines both data and process 2. ‘The main aim of Object Oriented Design (OOD) is to improve the quality and productivity of system analysis and design by making it more usable 3. Inanalysis phase, OO models are used to fill the gap between problem and solution. 4. Itperforms well in situation where systems are undergoing continuous design, adaption, and maintenance. 5. It identifies the objects in problem domain, classifying them in terms of data and behavior. 6. Following are the benefits of abject-oriented approach : It facilitates changes in the system at low cost. b. It promotes the reuse of components. ©. It simplifies the problem of integrating components to configure large system. 4. Itsimplifies the design of distributed systems. Que 1.2. | Describe the elements of object-oriented system. Answer Following are the elements of object-oriented system 1. Objects: An object is something that is exists within problem domain and can be identified by data (attribute) or behavior. b. Alltangible entities (student, patient) and some intangible entities (bank account) are modeled as object. (CSAT-Sem-5) Object Oriented System Design 13h t Oriented System Design 2 Attributes: They describe information about the object. & Behavior 1a, It speeifies what the object can do. b. It defines the operation performed on objects. 4 Class: ; a. Aclass encapsulates the data and its behavior. b. Objects with similar meaning and purpose grou; class. 5. Methods : a, Methods determine the behavior of a class. b. They are nothing more than an action that an object can perform. & Message: a. Amessage is a funetion or procedure call from one object to another. b. They are information sent to objects to trigger methods, Que 13. | Describe the features of object-oriented languages ? sped together as [AKTU 2012-18, Marks 05 oR Explain the major features of Object-Oriented Programming. AKTU 2013-14, Marks 05 ‘Answer Features of object-oriented language are : 1. Encapsulation : i. Eneapsulation means that data are encapsulated inside an inviolable shell along with the methods required to use it. Object 1 Object 2 Moss ett Fig. 1.8.1, Message passing between objects with encapsulation, activating methods that can use or modify the data. within their object. 1-4L (CSIT-Sem-5) Introduetion ii, The only way to reach the data is through these particular methods (see Fig. 13.0, iio. i, Tt is the mechanism that binds together code and the data i Ii csi "a fe and the data it iv. This concept is also used to hide th ¢ internal representation, or state, of an object from the outside. ah seprpeeolatio. Polymorphism : i, Polymorphism means having many forms, ii Polymorphism is the ability of a message to be displayed in more than one form, It plays an important role in allowing objects having different internal structure to share the tame external interface, Inheritance : i. Inheritance is the ability to create classes that share the attributes and methods of existing classes, but with more specific features. ii, Inheritance is mainly used for eode reusability. Que id. | Describe steps of object-oriented design, ‘Answer Steps of object-oriented design: 1, System analysis : [ARTO SOTO, Mare 05) In this stage a statement of the problem is formulated and a model is build. This phase show the important properties associated with the situation, ii The analysis model isa concise, precise abstraction and agreement ‘on how the desired system must be developed. ii The objective is to provide a model that ean be understood by any application experts in the area. 2 System design: i At this stage, the complete system architecture is designed, In this stage the whole system is divided into subsystems, based on system analysis model and the proposed architecture of the system, 3. Object design : i At this stage, a design model is developed based on the analysis, model, ‘The object design decides the data structures and algorithms needed toimplement each of the classes in the system, 1-5 L (CS/IT-Sem-5) Object Oriented System Design SS aa implementation: venin eon ne tal mgeetatin oases ode sc lates ae nel done using software engineering ‘and extensible system. i be ‘Actual implementation should practice. This helps to develop a flexible GSLs | Ditferentiate between structured approach an¢ oriented approach. “Answer S.No] Structured approach 1 [It works with Top-down|It works approach, approach. aoe i i raving Z| Programs divided into number | Program is organized by * | (feub modules er functions, | number of classes and objects, 3.__| Function call is used. Message passing is used. 4. [Software reuse is not possible, | Reusability is possible. 5. [Structured design| Object oriented design programming usually eft until | programming done concurrently end phases. with other phases. [Structured Design is more|It is suitable for in-house suitable for off-shoring, development. 7, | It chows clear transition from | Notso clear transition from design designtoimplementation. | toimplementation. Z |It is suitable for real time|It is suitable for most business system, embedded system and | applications, game development projects where objects are not | projects, which are expected to the most useful level of] customize or extended. 1d object ‘Object oriented approach with Bottom-up ahstraction 9. | DFD & E-R diagram model the | Class diagram, sequence diagram, data. state chart diagram, and use cases allcontribute. 10. | Inthis, projects ean be managed | In this approach, projects can be easily due to clearly identifiable | difficult to manage due to uncertain phases. transitions between phases, Que wi programming with object-oriented programming with examples. ARTU 2012-15, Marks 08 e short notes on : Compare procedural oR. What is the dire e difference Tangunge and Oloeree between Program is divi | Parts called functions, Procedural follows top do +-Oriented py 1. | in procedural progenies Programming, In objectonem =e | ed ota siall yeceisventoa 7 Programming] Obj wn. approach, toe eee | There is no access specifier in Object- rocedural programm oriented program ® eal progr ining. access specifiers like a Pacts Public, protectedete, Pn *** ding new data and funetion| Addi isnot easy. hnetion/ Adding new data and function 5. | 5 | Procedural programming does| not have any proper way for| provides data hiding eo itis more hiding data so it is less secure. | secure, Object-oriented programming 6. | In procedural programming, | Overloading is possible in overloading is not possible. | object-oriented programming. than data. In procedural programming, | In object-oriented programming, function is more important] data is more important than function, based on unreal world 8. | Procedural programming is| Object-oriented programming is based on real world. 9. | Examples Pascal, Basic etc. ©, FORTRAN, | Examples : C++, Java, Python, C#ete. unders ith Que LF | What do you of object-oriented technolOsY Wi Discuss the pros and cons suitable example. tand by object-oriented techno? 7, Marks ‘ARTO 201 1-7 L(CSAT-Sem-5) Object Oriented System Design HE = ted techniques ? Explain with at do you mean hy object-orien isestien von ATO OTL IS, Manin 10 some examples. | ject-Oriented Technology (OO) is an + Metso an development hat tempt ‘with conventional programming techniques. 2. Iisanew way of organigingand developing programs ‘and has nothing todo with any particular programming language. | However, otal languages are suitable oimploment to obee-oriented concepts or implement partial features of object-oriented concept. Pros of object-oriented technology are t ; 1, Hallows parallel development : If we are working with programming teams, then each can work independently of one another once the ‘modular classes have been worked out, 2 The modular classes are often reusable : Once the modular classes havebeen crested, they can often be used again in other applications or projects. 3 The coding is easier to maintai 1. With OOP, because our coding base has been centralized, itis easier to create a maintainable procedure code. , ‘That makes it easier to keep our data accessible when it becomes necessary to perform an upgrade. This process also improves the security of the programming since high levels of validation are often required, Cons of object-oriented technology are : 1. Itisinefficient: yosch to program a eBtce some ofthe issues Object-oriented programming tends to use more CPU than alternative options b, ‘That can make it inefficient choice when there are technical limitations involved due to the size 2 Itissealable: & If OOP is out of control, then it ean create a massive amount of bloated, unnecessary code, “ b, When that occurs, the overhead rises and that makes it difficult to ‘keep costs down, & Iecauses duplication : & OOP projects tend to be easier to design than implement, >, That is because of the modular classes that are so flexible in their application, 1-8L (CSIT-Sem-5) © We may be able to speed, but that come: like they have been cloned Qui 1.8. | What do you understand by object ide: with an example, Answer 1. Object identit; ity is a property of data object data model, where an aie identifier, or object 1D. . 2. The object identi identifier is used to define to support retrieval and comparion internal identifier rather th 3. There are many techni languages. 4. 00 languages have built is no need to ereate explicit object ide +hat is created in thy i fe context of an assigned a unique internal object associations between objects and parison of object-oriented data he an the attribute values of an abject mae iques for identifying objects in programming mechanisms for identifying objects. There nti types. 5. For example : In C++ an objects actual memory address serves a unique identifier and ean be obtained object or object reference. 6. Object identity can be tested by point by applying the'&' operator to an fer comparison. Que 19. ] Explain encapsulation with example. oR Discuss the concept of encapsulation with suitable example. oR, What do you mean by encapsulation ? concept of message passing help to en of an object, including its data? kaw | 1. Encapsulation consists which are acces details of the object, which are hidd 2, Encapsulation prevents a program that asmall change has massive rippl 3 The implementation of an object can applications that use it. of separating ble to other objects, from t jen from other objects. from becoming so interdey TARTU 201218, Maiies 05, How does the object-oriented capsulate the implementation ARTU 2010-11, Marks 05 the external aspects of an object, jhe internal implementation pendent Je effects. be changed without affecting the Object Oriented System Design L-9L(CSMT-Sem-5) 4. One may want to change the implementation of an object to improve performance, fix a bug, consolidate code, or for porting. 5, To understand encapsulation, let us consider the object Employee. ‘The attributes of employees say ‘salary’ is kept hidden inside the object ‘and may be made accessible only through the method meant for the purpose, 7. ‘The method rosides within the object. For example, ifgetSalary) is a mothod of the object Employee’ to get the salary of anemplayee, then the salary of an employee can be obtained by no other way but by this method, 5. Other objects can also send messages to the object ‘Employee’ and get the salary of an employee by the getSalary() method. 9. Other objects need not be concerned with the attributes and internal structure of the object. 40. ‘This is shoven in Fig. 1.9.1. The figure shows that attributes are hidden inside the object by a method, Methoss faxreibuts hidden Fig. 1.94. Encapsulation ofan obiect, Using message passing to encapsulate the implementation of ‘an object : Other pers ofa system only see an object's interface (services jt ean perform and operation signatures), Internal details including data. fare hidden and can only be accessed by a message that contains a valid signature. Que L10,| Write short note on information hiding. ez 1. Information hiding is the process of hiding the details of an object or fanetion, 2 ‘The hiding of these details results in an abstraction, which reduces the ext-raal complexity and makes the object or function easier to use 3, In addition, information hiding effectively decouples the calling code from the internal workings of the object or Function being called, which ‘makes it possible to change the hidden portions without having to also change the calling code Int gem 6) $a ouicstTsem) Ai 101 (aT Sem pon technique PFOEFAMMETS Use 9 jg sulation is 800 4 Bezemation di dingis yielding Nexibility, » comet ering | Roars tae oo . Structural model represents the framework for the system and this framework is the place where all other components exist. © Hence, the class diagram, component diagram and deployment diagrams are part of structural modeling. 4 Thoy all represent the elements and the mechanism to assemble © The structural model never describes the dynamic behavior of the system, 2% Behavioral Modeling : a Behavioral model describes the interaction in the system, b. Terepresents the interaction among the structural diagrams, & Behavioral modeling shows the dynamic nature of the system. a aranslsts of Activity diagrams, Interaction diagrams, Uso case % Architectural Modeling : 3 Architectural model represents the overall framework of the systom. * _ Tecontains both structural and behavioral clements of the system. Object Oriented System Design 23 L (CSAT-Sem-5) Architectural model can be defined as the blueprint of the entire system. d._ Package diagram comes under architectural modeling. UML : Refer Q. 1.20, Page 1-191, Unit-1. Que 22, | What do you understand by architectural modeling ? Explain its various concepts and diagrams with suitable example. (AKTU 2010-11, Marks 05) oR Write short notes on architectural modeling with suitable example and diagrams, [ARTU 2012-18, Marks 06] ‘Answer Architectural modeling: 1. Architectural modeling represents the overall framework of the system. 2. It contains bth 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 part of a system that packages implementation and provides the realization ofa set of interfaces. b. component is a physical manifestation of an object that has a well-defined interface and a set of implementations for the interface, ¢. Acomplex system can be built using software components. It enhances re-use in the system and facilitates system evolution.

You might also like