SWE 4201: Exploring Object-Oriented Concepts in Programming

Verified

Added on  2023/02/01

|23
|1237
|77
Homework Assignment
AI Summary
This document provides a detailed explanation of object-oriented programming (OOP) concepts. It begins by contrasting procedural programming with OOP, highlighting the limitations of the former and the advantages of the latter, such as improved modularity and maintainability. The document then defines key OOP terms like objects and classes, explaining their roles and relationships. Numerous examples are provided to illustrate how to identify classes, their properties (attributes), and behaviors (methods) within different problem scenarios, including examples related to university programs, electronic equipment, and shapes. The document also includes examples of class and object diagrams and explains how to translate real-world scenarios into object-oriented designs. The content is structured to provide a clear understanding of OOP principles, making it a useful resource for students studying software engineering or related fields.
Document Page
Object Oriented Concepts
SWE 4201
1
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Agenda
Programming
Procedural programming
Object oriented programming.
Features of OOP
OOP concepts (Object and Class)
Document Page
Programming
Programming is the craft of transforming requirements into
something that computer can execute.
Document Page
Procedural programming
Programmer implements requirement by breaking down them to
small steps (functional decomposition).
Programmer creates the “recipe” that computer can understand and
execute.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Procedural programming …..
What’s wrong with procedural programming language?
When requirements change
It hard to implement new feature that were not planned in the beginning.
Code blocks gets bigger and bigger.
Changes in code introduce many bugs.
Code gets hard to maintain.
Document Page
Worst thing is that
Requirement
always change
Document Page
Object oriented programming
Break down requirements into objects with responsibilities, not into
functional steps.
Embraces change of requirements.
By minimizing changes in code.
Lets you think about object hierarchies and interactions instead of
program control flow.
A completely different programming paradigm.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Why OOPS?
To modularize software development, just like any other engineering
discipline.
To make software projects more manageable and predictable.
For better maintainability, since software maintenance costs were
more than the development costs.
For more re-use code and prevent ‘reinvention of wheel’** every
time.
**reinventing the wheel is a phrase that means to duplicate a basic method that has already previously
been created or optimized by others
Document Page
Features of OOP
Emphasis on data rather on procedure.
Programs are divided into what are known as “objects”.
Functions that operate on data of an object are tied together in a data
structure.
Object may communicate with each other through functions.
New data and functions can be added easily whenever necessary.
Document Page
Object
Anything that we see in real life is an object.
Ex: Car, Man, Pencil
Sometimes immaterial things can also be objects.
Ex: Project, Process, Ghost
In a class based object-oriented programming, object is an instance
of a class that is created dynamically.
When an object is instantiated, it is allocated with a block of
memory and configured as per the blueprint provided by the class
underlying the object.
10
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Class
Classes are about defining an object. It consists of attributes and
behaviors.
Simply, Class is a blueprint of an object or template for an object.
We can consider a Class as a new data type.
11
Document Page
Object and Class
Class is a template for an object and an object is an instance of a
class
Class is just a logical framework, object is the physical reality.
12
chevron_up_icon
1 out of 23
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]