Chapter 10 Textbook Notes
Chapter 10 Textbook Notes
Activity Diagrams
- Arrow = event
o Things happening at certain time/place
- Diamond = decision
- Long, flat rectangle = synchronization bar
o Show parallel activities
- Rectangles surrounding other symbols = swim lanes
o Partitioning
Class Diagrams
Method Overloading
Types of Classes
- Entity classes
o Real-world items
People, things, etc.
o ER Diagram
- Boundary (Interface) Class
o Means for users to work w/the system
o Human
Display, window, dialog box, etc.
o System
Sending data to or receiving data from other systems
Databases
XML (external)
- Abstract Class
o Cannot be directly instantiated
instantiation is the creation of a real instance or particular
realization of an abstraction or template, such as a class of objects
or a computer process.
- Control Classes
o Used to control the flow of activities
o Use many small control classes to create reusable classes
o Often used to make another class reusable
o Example
Logon process that wants to be reused
- Presentation layer
o What the users sees
o Contains interface or boundary classes
- Business layer
o Unique rules for the app
o Contains control classes
- Persistence (data access) layer
o Describes obtaining and storing data
o Contains the entity classes
- Ideally, program code would be written separately for each of these layers
- AJAX helps with rapid validation instead of waiting for web pages to load
Relationships
Associations
- When one class represents a whole object and other classes present parts of that
object.
- Whole acts as a container for the parts
- Line with diamonds
o Human can exist without a hand, but not without a brain and heart
o Cannot be a boxer without both hands
Aggregation
- “has a” relationship
- Show that the whole object is composed of the sum of its parts (other objects)
- Weaker relationship not filled diamond
- Stronk relationship filled in diamond
- See example above
Collection
- A whole/part relationship in which the whole has a responsibility for the part
- Strong relationship
- Filled in-in diamond
- “Always contain” another class
- If the whole is deleted, all parts are deleted
- If you delete the human the boxer is also deleted
- If you delete the hands the boxer is also deleted
- Insurance policy gets cancelled then all insurance members of that policy are also
cancelled
- If a course is cancelled all assignments and exams are also deleted
Specialization
Generalization
Inheritance
Polymorphism
- Capability of OO program to have several versions of the same method with the
same name within a super/sub class relationship
- Subclass inherits method but can modify it like change type of data or how it
works
Abstract Classes
- Look at database tables to see if they have the same elements or if a number of
classes have the same methods
- Banking example
o Withdrawal, payment on a loan, check written will use same method –
subtracting money from customer’s account
Finding Classes
Statechart Diagrams