Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Notes hand written lecture, Lecture notes of Operating Systems

All notes lecture handwritten of classes

Typology: Lecture notes

2022/2023

Uploaded on 10/21/2024

yash-garg-4
yash-garg-4 🇮🇳

2 documents

1 / 252

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Notes hand written lecture and more Lecture notes Operating Systems in PDF only on Docsity!

QUANTUM SERIES

TM

QUANTUM PAGE PVT. LTD.

Ghaziabad New Delhi

For

B.Tech Students of Third Year

of All Engineering Colleges Affiliated to

Dr. A.P.J. Abdul Kalam Technical University,

Uttar Pradesh, Lucknow (Formerly Uttar Pradesh Technical University)

Object Oriented System Design /

Object Oriented Programming

By

Kanika Dhama

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 L to 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.

CONTENTS

KCS-054 : OBJECT ORIENTED SYSTEM DESIGN

UNIT-5 : OBJECTS AND CLASSES (5–1 L to 5–19 L) 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 : Concept 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–1 L to SQ–15 L)

SOLVED PAPERS (2010-11 TO 2015-16) (SP–1 L to SP–25 L)

Object Oriented System Design (KCS- 054 ) Course Outcome ( CO) Bloom’s Knowledge Level (KL)

At the end of course , the student will be able to:

CO 1

Understand the application development and analyze the insights of object oriented programming to implement application

K 2 , K 4

CO 2 Understand, analyze and apply the role of overall modeling concepts (i.e. System, structural) K 2 , K 3 CO 3 Understand, analyze and apply oops concepts (i.e. abstraction, inheritance) K 2 , K3, K 4

CO 4

Understand the basic concepts of C++ to implement the object oriented concepts K 2 , K 3

CO 5 To understand the object oriented approach to implement real world problem. K 2 , K 3

DETAILED SYLLABUS 3 - 0 - 0

Unit Topic Proposed

Lecture

I

Introduction: 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.

08

II

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.

08

III

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.

08

IV

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

08

V

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 : Concept of Inheritance, types of inheritance: single, multiple, multilevel, hierarchical, hybrid, protected members, overriding, virtual base class Polymorphism : Pointers in C++, Pointes and Objects, this pointer, virtual and pure virtual functions, Implementing polymorphism

08

Text Books

  1. James Rumbaugh et. al, “Object Oriented Modeling and Design”, Pearson Education
  2. Grady Booch, James Rumbaugh, Ivar Jacobson, “The Unified Modeling Language User Guide”, Pearson Education
  3. Object Oriented Programming With C++, E Balagurusamy, McGraw Hill.
  4. C++ Programming, Black Book, Steven Holzner, dreamtech
  5. Object Oriented Programming in Turbo C++, Robert Lafore, Galgotia
  6. Object Oriented Programming with ANSI and Turbo C++, Ashok Kamthane, Pearson
  7. The Compete Reference C++, Herbert Schlitz, McGraw Hill.

Curriculum & Evaluation Scheme CS & CSE (V & VI semester) 11

Object Oriented System Design 1–1 L (CS/IT-Sem-5)

CONTENTS

Part-1 : Introduction, The Meaning ..................... 1–2L to 1–11L of Object Orientation, Object Identity, Encapsulation, Information Hiding, Polymorphism, Generosity

Part-2 : Importance of Modelling, ...................... 1–11L to 1–19L Principles of Modelling, Object-oriented Modelling

Part-3 : Introduction of UML, ............................. 1–19L to 1–22L Conceptual Model of UML, Architecture

Introduction

Object Oriented System Design 1–3 L (CS/IT-Sem-5)

2. Attributes : They describe information about the object. 3. Behavior :

a. It specifies what the object can do. b. It defines the operation performed on objects.

4. Class :

a. A class encapsulates the data and its behavior. b. Objects with similar meaning and purpose grouped together as class.

5. Methods :

a. Methods determine the behavior of a class. b. They are nothing more than an action that an object can perform.

6. Message :

a. A message is a function or procedure call from one object to another. b. They are information sent to objects to trigger methods.

Que 1.3. Describe the features of object-oriented languages?

AKTU 2012-13, 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. Encapsulation means that data are encapsulated inside an inviolable shell along with the methods required to use it.

Message C

Method 2

Method 1

Data

Method 3

Message B Message A

Method 1

Method 5 Method 6

Data

Object 1 Object 2

Fig. 1.3.1. Message passing between objects with encapsulation, activating methods that can use or modify the data within their object.

Introduction 1–4 L (CS/IT-Sem-5)

ii. The only way to reach the data is through these particular methods (see Fig. 1.3.1). iii. It is the mechanism that binds together code and the data it manipulates. iv. This concept is also used to hide the internal representation, or state, of an object from the outside.

2. Polymorphism :

i. Polymorphism means having many forms. ii. Polymorphism is the ability of a message to be displayed in more than one form. iii. It plays an important role in allowing objects having different internal structure to share the same external interface.

3. 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 code reusability.

Que 1.4. Describe steps of object-oriented design.

AKTU 2010-11, Marks 05

Answer

Steps of object-oriented design :

1. System analysis :

i. 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 is a concise, precise abstraction and agreement on how the desired system must be developed. iii. The objective is to provide a model that can be understood by any application experts in the area.

2. System design :

i. At this stage, the complete system architecture is designed. ii. 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. ii. The object design decides the data structures and algorithms needed to implement each of the classes in the system.

Introduction 1–6 L (CS/IT-Sem-5)

What is the difference between Procedure Based programming language and Object-Oriented programming language?

AKTU 2013-14, Marks 05

OR

Write short notes on : Procedural v/s OOP.

AKTU 2013-14, Marks 05

Answer

S. No. Procedural Oriented Object-Oriented Programming Programming

Que 1.7. What do you understand by object-oriented technology?

Discuss the pros and cons of object-oriented technology with

suitable example. AKTU 2011-12, Marks 10

  1. In procedural programming, program is divided into small parts called functions.
  2. Procedural programming follows top down approach.
  3. There is no access specifier in procedural programming.
  4. Adding new data and function is not easy.
  5. Procedural programming does not have any proper way for hiding data so it is less secure.
  6. In procedural programming, overloading is not possible.
  7. In procedural programming, function is more important than data.
  8. Procedural programming is based on unreal world.
  9. Examples : C, FORTRAN, Pascal, Basic etc.

In object-oriented programming, program is divided into small parts called objects.

Object-oriented programming follows bottom up approach.

Object-oriented programming has access specifiers like private, public, protected etc.

Adding new data and function is easy.

Object-oriented programming provides data hiding so it is more secure.

Overloading is possible in object-oriented programming.

In object-oriented programming, data is more important than function.

Object-oriented programming is based on real world.

Examples : C++, Java, Python, C# etc.

Object Oriented System Design 1–7 L (CS/IT-Sem-5)

OR What do you mean by object-oriented techniques? Explain with

some examples. AKTU 2012-13, Marks 10

Answer

  1. Object-Oriented Technology (OOT) is an approach to program organization and development that attempts to reduce some of the issues with conventional programming techniques.
  2. It is a new way of organizing and developing programs and has nothing to do with any particular programming language.
  3. However, not all languages are suitable to implement the object-oriented concepts or implement partial features of object-oriented concepts. **Pros of object-oriented technology are :
  4. It allows 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 have been created, they can often be used again in other applications or projects. 3. The coding is easier to maintain :

a. With OOP, because our coding base has been centralized, it is easier to create a maintainable procedure code. b. That makes it easier to keep our data accessible when it becomes necessary to perform an upgrade. c. This process also improves the security of the programming since high levels of validation are often required. Cons of object-oriented technology are :

1. It is inefficient :

a. 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. It is scalable :

a. If OOP is out of control, then it can create a massive amount of bloated, unnecessary code. b. When that occurs, the overhead rises and that makes it difficult to keep costs down.

3. It causes duplication :

a. OOP projects tend to be easier to design than implement. b. That is because of the modular classes that are so flexible in their application.

Object Oriented System Design 1–9 L (CS/IT-Sem-5)

  1. One may want to change the implementation of an object to improve performance, fix a bug, consolidate code, or for porting.
  2. To understand encapsulation, let us consider the object ‘Employee’.
  3. 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.
  4. The method resides within the object.

For example , if getSalary() is a method of the object ‘Employee’ to get the salary of an employee, then the salary of an employee can be obtained by no other way but by this method.

  1. Other objects can also send messages to the object ‘Employee’ and get the salary of an employee by the getSalary() method.
  2. Other objects need not be concerned with the attributes and internal structure of the object.
  3. This is shown in Fig. 1.9.1. The figure shows that attributes are hidden inside the object by a method.

Methods

Message (^) Attribute Message hidden

Fig. 1.9.1. Encapsulation of an object.

Using message passing to encapsulate the implementation of an object : Other parts of a system only see an object’s interface (services it can perform and operation signatures). Internal details including data are hidden and can only be accessed by a message that contains a valid signature.

Que 1.10. Write short note on information hiding.

Answer

  1. Information hiding is the process of hiding the details of an object or function.
  2. The hiding of these details results in an abstraction, which reduces the external 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.

Introduction 1–10 L (CS/IT-Sem-5)

  1. Encapsulation is a common technique programmers use to implement information hiding.
  2. Advantage of information hiding is yielding flexibility, such as allowing a programmer to more readily modify a program.
  3. This also may be done by placing source code within modules for easy access in the future, as the program develops and evolves.

Que 1.11. What do you mean by polymorphism? Explain it with

an example. AKTU 2012-13, Marks 05

OR

What do you mean by polymorphism? Is this concept only applicable to object-oriented systems? Explain.

AKTU 2010-11, Marks 05

OR

Define polymorphism. Is this concept only applicable to object-

oriented systems? Explain. AKTU 2014-15, Marks 05

Answer

  1. Polymorphism means having many forms.
  2. Polymorphism is the ability of a message to be displayed in more than one form.
  3. It plays an important role in allowing objects having different internal structure to share the same external interface.
  4. An operation is a function that may be applied to or by objects in a class.
  5. Open , close , hide , and redisplay are operations on class Window. All objects in a class share the same operations.
  6. Each operation has a target object as an implicit argument.
  7. The behavior of the operation depends on the class of its target.
  8. An object “knows” its class, and hence the right implementation of the operation.
  9. The same operation may apply to many different classes. Such an operation is polymorphic; i.e. , the same operation takes on different forms in different classes.
  10. For example, the class File may have an operation print.
  11. Different methods could be implemented to print ASCII files, print binary files, and print digitized picture files.
  12. All these methods logically perform the same task. However, each method may be implemented by a different piece of code.

Introduction 1–12 L (CS/IT-Sem-5)

a. Testing a physical entity before building it :

i. Simulating a model is cheaper. Also, it provides information that is too inaccessible to be measured from physical model. ii. Computer models are usually cheaper than building a complete system and it enable flaws to be corrected early. For example : Scale models of airplane and cars are tested in wind tunnels to improve their aerodynamic.

b. Communication with customers :

i. Software designers build models to show their customers. For example : Demonstration products like mock-ups that imitate some or all of the external behavior of a system.

c. Visualization :

i. Storyboards of movies, television shows, and advertisements allow the writers to see how their idea flows. ii. Using models unnecessary segments can be modified before the final development begins.

d. Reduction of complexity :

i. Modeling helps in understanding the systems that are too complex to understand directly. ii. Model reduces complexity by leaving out the non essential details.

Que 1.13. What are the different models used in object oriented

languages? OR Write short note on dynamic modeling and functional modeling.

AKTU 2011-12, Marks 05

Answer

There are three types of models in object oriented languages are :

1. Object model :

a. The object model identifies the classes in the system and their relationship, as well as their attributes and operations. b. It represents the static structure of the system. The object model is represented graphically by a class diagram.

2. Dynamic model :

a. The dynamic model indicates the dynamics of the objects and their changes in state. b. The dynamic model captures the functional behavior of the system by exploring the behavior of the objects over time and the flow of control and events among the objects.

Object Oriented System Design 1–13 L (CS/IT-Sem-5)

3. Functional model :

a. The functional model is a data flow diagram of the system and describes what the system does, not how it is done. b. A DFD is a network representation of the system to show the functional relationships of the values that are computed by a system. c. Data flow diagrams consist of processes, data flows, actors and data stores.

Que 1.14. Write short notes on :

a. Data store b. Actors

c. Control flow AKTU 2015-16, Marks 15

Answer

a. Data store :

  1. A data store is a passive object within a data flow diagram that stores data for later access.
  2. Unlike an actor, a data store does not generate any operations on its own but merely responds to requests to store and access data.
  3. A data store allows values to be accessed in a different order than they are generated.
  4. A data store is drawn as a pair of parallel lines containing the name of the store.
  5. Input arrows indicate information or operations that modify the stored data; this includes adding elements, modifying values, or deleting elements.
  6. Output arrows indicate information retrieved from the store. This includes retrieving the entire value or some component of it.

b. Actors :

  1. An actor is an active object that drives the data flow graph by producing or consuming values.
  2. Actors are attached to the inputs and outputs of a data flow graph.
  3. Examples of actors include the user of a program, a thermostat, and a motor under computer control.
  4. An actor is drawn as a rectangle to show that it is an object. Arrows between the actor and the diagram are inputs and outputs of the diagram.

c. Control flow :

  1. A data flow diagram shows all possible computation paths for values; it does not show which paths are executed and in what order.