Download presentation
Presentation is loading. Please wait.
Published byMelvin Mathews Modified over 9 years ago
1
CSE 2341 Object Oriented Programming with C++ Note Set #4
2
Procedural/structures vs. OOP First Class
Quick Look Procedural/structures vs. OOP First Class
3
Procedural vs OOP Procedural Object Oriented Programming (OOP)
focused on procedures that take place in a program data is secondary to functionality Object Oriented Programming (OOP) concerned with understanding the objects involved in a problem and how they interact.
4
Problems with Procedural Programming
excessive global data larger solutions are complex and convoluted can be very difficult to understand, modify, and extend
5
OOP focuses on the objects and their interaction based on the problem domain packages together the data and methods to operate on that data sometimes called attributes and behavior
6
Concept Point Create a Point class that represents a point in 2D space
int x int y getX() setX(newX) interface distance(anotherPoint) Private Data and Methods to operate on that data
7
Objects Range of possibilities is limited by programmers imagination
Usually very specific or very general general purpose: Vector class, some datatype not part of language such as date, GUI objects specific purpose: objects created for a specific application domain such as inventory
8
Benefits of OOP Data abstraction Compatibility Flexibility
details of classes only visible to its methods Compatibility easier to combine software components Flexibility classes provide units for task allocation
9
Benefits of OOP Reuse Extensibility Maintenance
easier to develop reusable software Extensibility inheritance allows new classes to be built from old ones Maintenance The natural modularity of the class structures makes it easier to contain the effects of change
10
Fini ?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.