Title: Object Oriented Architecture and Design
1Object Oriented Architecture and Design
2The problem with words
3Clarity
- They both agree about abstraction and
encapsulation - Booch
- Modularity
- Hierarchy
- Ganesh
- Inheritance
- Polymorphism
- Booch has a higher view in his choice of words
- Ganesh is a bit more practical
43 Fundamentals of Object-Oriented Paradigm
- Encapsulation - a class includes both the data
and operations that operate on the data. It can
hide the implementation details. - A user of the class only sees the public
interface. - You use the concepts of abstraction, modularity
and hierarchy to create this. - Polymorphism - many classes can perform the same
behavior and we can use them interchangeably. - You use abstraction, modularity, encapsulation
and inheritance to create this - Inheritance - one class can build on top of
another class and inherit all its methods and
attributes. - You are using abstraction, modularity and
hierarchy to create this
5Modularity and abstraction
6Hierarchy and Layers
7The first practical application of the theory
Layers
8Right click gt Add gt New Folder
9You have added Layers to your class library
10Definitions
11Example website
12Here is an example of a web page making a call to
create an invitation
13Add entities (these are what you have been
making)
14Add the logic layer class
15Add communication layer class
16Review Namespaces
- Namespaces allow you to create a system to
organize your code. - Namespaces are hierarchical
- The dot operator is used to define the hierarchy
- Examples
- MyEngineWithLayers.Logic.Invitation
- MyEngineWithLayers.Communication.Invitation
- MyEngineWithLayers.Entity.Invitation
- MyEngineWithLayers.DataAccess.Invitation
- Dot Operator
- Logic.Invitation is actually shorthand for
defining a namespace named Invitation that
contains a namespace named Logic - You invoke a method on class by writing the name
of the object followed by the dot operator and
then the method name
17Let add a test project and see our layers
working. (also add reference, import namespace)
18Test method
19Run the test
20Debug
21Test results