Download presentation
Presentation is loading. Please wait.
Published byNancy Bruce Modified over 9 years ago
1
Object Oriented Design John Donald
2
What is OOD? OOD stands for Object Oriented Design It is a concept that forces programmers to plan and organize their code It reduces the unnecessary re-creation of code This design protects data from external entities
3
What is OOD? OOD is or has: Organized and clean Designed using systems of self-contained objects and classes Reduces the repetition of code System functionality Expressed in terms of object services Shared data areas are eliminated Objects communicate by message passing Easier maintenance
4
Object-oriented development process Class & Object Semantics These semantics are the ideas that encapsulate what each class should implement This would be the equivalent to coming up with the function prototypes to a.h file in C or C++ Class & Object Relationships These are defined to show the relation each object has to one another and the overall application This also allows for objects to interact with each other
5
This process implements a consistency within the application Makes objects require consistent information to interact with each other and the application The perspective of the OOD development process Takes into account each role every object is to play Modular overview of how the program will work together Object-oriented development process
6
Coding Examples of coding in object oriented fashion are creating a base class with given attributes A following class can further extend that base class to be a more specified version of that base class Eg: Base Class: Shapes; Extended Class: Circle Extended Class: Square This example gives us a shape base class and a class that is a more specified shape class with certain attributes that only circles have or that only squares have, such as 4 sides etc. Object-oriented development process
7
Testing Testing code that is sectioned into classes is far easier to debug than code that is not This is due to the fact that if something goes wrong within an instantiation of an class (an object) you know which “schematic” or class to look at and see where it went wrong A typical way of Object-Oriented development is the waterfall model as seen on the next slide Object-oriented development process
9
Use Cases A Use case is a single task performed by the end user of a system that has a useful outcome These outcomes can be represented as an organizational goal, or a product like a report There is always an outcome that has a perceived value There are many different goals for use cases: 1. Develop an increased understanding of the problem 2. Communicate with the end user to make sure problems are getting solved 3. Organize the dynamic behavior of the design 4. Provide a road map for development process
10
UML is also known as the Unified Modeling Language Its purpose is to be used as a standard way to visualize the design of a system. This is very handy when trying to show an application’s design structure in an OOD fashion Projects can be structured using UML and then that structure can be pushed to the developers where each dev group can know what part they play to the overall development OOD using UML
11
Object-oriented system design In this stage the complete architecture of the desired system is designed The system is a group of subsystems constructed in order of a hierarchy of interacting objects which are grouped by their respective classes. This design is done according to both the system analysis model and the purposed system architecture. The emphasis is on the objects that make up the system rather than the processes that the system performs This design forms relationships between the respective classes as well
12
UML diagrams - Package The Image on this slide is an example of a package diagram A package diagram depicts the dependencies between the packages that make up a model In this case the Domain model has both PageInfo and SortInfo. The Search model can both import PageInfo and access SortInfo
13
Class description template is simply a template of how a class should be designed and with given attributes from the diagram UML diagrams – Class template
14
A sequence diagram is a diagram that shows how a process or multiple processes operate and in what order UML diagrams – Sequence
15
A collaboration diagram can show the relationship and interaction between software objects. They demonstrate the communication between classes and objects UML diagrams UML diagrams – Collaboration
16
State diagrams show the movement of the current state within a program. The circle with no outer circle represents the initial state and the circle with a circle around it represents the final or goal state. These diagrams typical show the process from the start to a goal UML diagrams – State
17
Activity diagrams are a graphical workflow of actions that are taken in steps and the results of each action given a sequence of steps UML diagrams – Activity
18
Classes contain the information (functions, variables, actions) that each object will have Objects are abstractions of real-world entities and manage themselves Objects are independent of each other and contain their own information Objects can be manipulated and their functions overridden by using polymorphism Polymorphism allows for a function or class to have the same name but take different data types An example of its implementation would be having the schematic to a car (class) vs having a car built from that schematic (object). Object-oriented program design (OOP)
19
Interfaces An object’s interface is simply the description of the actions it can do There are NO variables listed within an interface An interface is strictly about the actions that are allowed This means that the only things listed in the interface would be related functions These functions must also only be prototypes Interfaces allow the programmer to be more abstract while referencing objects Object-oriented program design (OOP)
20
Here is an example of inheritance from a standard bank account program Notice how the 3 more specified accounts inherit from the more generic BankAccount Object-oriented program design (OOP)
21
Now that we looked at inheritance what are its main advantages to compositional programming? Inheritance reduces the amount of code that may have to be reproduced for multiple tasks Inheritance is cleaner and often times keeps the programmer from making multiple mistakes throughout the code Compositional programming is usually harder for other programmers to interpret how the program was written and the functionality of it
22
The golden rule of OOP: design for change Object-oriented programming is innately designed to make changes easier This type of programming encourages extending classes instead of re-writing the programs architecture This type of design is also easier for the programmers that come in after the original programmer and need to add some functionality to it This aids in the speed with which programs are designed as well as how easily the secondary programmers can come in and add their own functionality by making another class without breaking the original functionality Object-oriented program design (OOP)
23
Data management design OOD provides for a way of data management for persistent objects through implementation of a database Databases can store persistent objects that can then later be referenced within the program and their data can be used and updated to do what the programmer wills Some languages also allow for the recovery of deleted persistent objects This simply allows for the developer to “recover” lost data or temporarily delete data or objects
24
Data management via relational data base A relational database is a database whose use can be made to relate with other databases or tables within databases Most of these databases use SQL (Structured Query Language) The relational factors of the database involve setting primary keys and foreign keys which can relate data from one table to another Operations that are done on a table can also be transferred to another table depending on its relation to it Eg. If a record gets deleted from a table that was related to another table, that related record in the second table will also be deleted
25
There are two main focuses to task management, the first is event driven and the second is time driven An even driven task management design would be typically described as the waterfall method of development. The given steps are: Initiation Planning and design Execution and construction Monitoring and controlling systems Completion and finish point Task management design
26
There are two main focuses to task management, the first is event driven and the second is time driven cont… An time driven task management design would be typically described as the agile method of development. The given steps are: Inception Elaboration Construction Transition Each of these types of development processes have their own strengths and weaknesses Task management design
27
This spiral diagram represents the amount of work (depending on level of project) that an application can take and its respective repeating processes
28
Object-oriented measurement A measure is a numerical value computed from a collection of data. A Measure should have the following characteristics: The measure should be robust The measure should suggest a norm, scale, and bounds The measure should be meaningful A group of measures should be consistent
29
This is an example of measurements (middle area in all 4 images) with their respective functions and class names These measures show the characteristics of computational times etc. based on a certain dictionary of what these symbols mean Object-oriented measurement
30
Object-oriented design measures Weighted method per class Also known as WCM, measures the complexity of an individual class A class with more members is said to be more complex More weight, more error prone Depth of inheritance The maximum length from the class node to the root/parent node Measured by the number of ancestor classes
31
Number of children This is the number of subclasses from each class Classes with many children are said to be harder to modify The larger the measure of number of children the more complex and error prone a program is due to having to service these children Lack of cohesion in methods The number of disjoin/non-intersection sets of local methods High cohesion indicates that a class is subdivided well Lack of cohesion increases complexity and error Object-oriented design measures
32
Response for a class The response set of a class is a method or set of methods than can be executed in response to a message received by an object of that class The measurement for this is simply the number of methods that do this functionality in the set of methods Coupling between objects “The measure of the strength of association established by a connection from one module to another” An example is if objects A and B have a method that accesses variables from both A and B Object-oriented design measures
33
The Following slides contain examples of different metric systems
34
Chidamber-Kemerer metric System example with UML diagrams Metric applied to the example
35
Measuring from a sequence diagram
37
SOURCES: http://www.idt.mdh.se/kurser/cd5360/02/lectures/se- lectures-06.pdf http://www.idt.mdh.se/kurser/cd5360/02/lectures/se- lectures-06.pdf http://www.selectbs.com/process-maturity/what-is- object-oriented-design http://www.selectbs.com/process-maturity/what-is- object-oriented-design https://atomicobject.com/resources/oo- programming/oo-analysis-techniques https://atomicobject.com/resources/oo- programming/oo-analysis-techniques http://www.ibm.com/developerworks/library/co- design5/ http://www.ibm.com/developerworks/library/co- design5/ https://en.wikipedia.org/wiki/Unified_Modeling_Langu age https://en.wikipedia.org/wiki/Unified_Modeling_Langu age
38
SOURCES: continued… http://www.tutorialspoint.com/object_oriented_analys is_design/ooad_object_oriented_system.htm http://www.tutorialspoint.com/object_oriented_analys is_design/ooad_object_oriented_system.htm https://en.wikipedia.org/wiki/Package_diagram https://en.wikipedia.org/wiki/Package_diagram https://en.wikipedia.org/wiki/Sequence_diagram https://en.wikipedia.org/wiki/Sequence_diagram https://en.wikipedia.org/wiki/Activity_diagram https://en.wikipedia.org/wiki/Activity_diagram http://www.cs.utah.edu/~germain/PPS/Topics/interfac es.html http://www.cs.utah.edu/~germain/PPS/Topics/interfac es.html http://www.codeproject.com/Articles/768052/Golden- Rules-Of-Good-OOP http://www.codeproject.com/Articles/768052/Golden- Rules-Of-Good-OOP http://www.codeproject.com/Articles/768052/Golden- Rules-Of-Good-OOP http://www.codeproject.com/Articles/768052/Golden- Rules-Of-Good-OOP
39
https://en.wikipedia.org/wiki/Relational_database https://en.wikipedia.org/wiki/Relational_database https://en.wikipedia.org/wiki/Project_management https://en.wikipedia.org/wiki/Project_management http://www.sei.cmu.edu/reports/95tr002.pdf http://www.sei.cmu.edu/reports/95tr002.pdf http://agile.csc.ncsu.edu/SEMaterials/OOMetrics.htm http://agile.csc.ncsu.edu/SEMaterials/OOMetrics.htm http://www.aivosto.com/project/help/pm-oo-ck.html http://www.aivosto.com/project/help/pm-oo-ck.html Pfleeger, Shari Lawrence., and Joanne M. Atlee. Software Engineering: Theory and Practice. Fourth ed. Upper Saddle River, NJ: Prentice Hall, 2010. Print. SOURCES: continued…
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.