3. I - ShineTech and Workshop for OCA Course Promotion
• ShineTech, a professional training company
• Universities Partnerships
• Focused in the computing Market
• Promotes events in technology área
• Courses
• Workshops
• Entertainment
• Next Event ISTEC Auditorium Wednesday 7 PM
• Workshop
• OCA Preparation Course Promotion
• www.shinetech.co/events
Who we are?
4. I – GRASP in Enterprise Apps
• Elementary Design Patterns for System Development
• Define the responsibility to an object or a set of objects
(classes)
• General Responsibility Assignment Software Patterns
• Creator, Information Expert, Low Coupling , High Cohesion, Controller,
Polymorphism, Pure Fabrication, Indirection, Protected Variation
What is GRASP?
5. II – GRASP in Enterprise Apps
• Defines who creates an Object or instance of class
• Factories podem ser usadas usando SingleTons
Creator
6. III – GRASP in Enterprise Apps
• Gives to the object a expertize in a specific area
• DAO classes are experts in database access
• GUI classes are experts in human interface
Expert
7. IV – GRASP in Enterprise Apps
• Reduces the dependency between objects
• Improve maintenance and component reuse
• Using interfaces helps decoupling
Low Coupling
8. V – GRASP in Enterprise Apps
• MVC foi descrito em 1979
• MVC first used with Smalltalk 1969 ~ Java 1995
• Delegates GUI layer requests to Business Layer
• Controllers acts as Mediator
• Example of Controllers Delegating Business Rules
• Web Apps with MVC frameworks
• Normally implemented as Servlet (Action)
• Spring, Struts, JSF, etc.
Controller
9. VI – GRASP in Enterprise Apps
• Directing a class/object to only one responsibility
• Packages help the system to be cohesive
• It helps heaps the system maintenance
• Fundamental for low coupling promotion
High Cohesion
10. VII – GRASP in Enterprise Apps
• Multiple elements variation in the same object family
• Allows:
• Dynamic elements of the same family replacing in run-
time
• Practical examples:
• Printer drivers (Epson, Lexmark, HP,…)
• JDBC drivers (Oracle, DB2, PostgreSQL,…)
Polymorphism
11. VIII – GRASP in Enterprise Apps
• Assign responsibility that is not related to the app
domain
• Example of needed classes that are pure fabrication:
• DAO classes
• Log classes
Pure Fabrication
12. IX – GRASP in Enterprise Apps
• To avoid the direct relationship between elements
• Supply an intermediate unit to communicate units
• Forces the unit decoupling
• Examples of implementation:
• Façades
• Interfaces
Indirection
13. X – GRASP in Enterprise Apps
• Pattern to avoid the elements variations (changes) in
other elements
• Examples:
• Data encapsulation (private attributes)
• Interfaces
Protected Variation
14. XI – GRASP in Enterprise Apps
• Creator
• Information Expert
• Low Coupling
• Controller
• High Cohesion
• Indirection
• Polymorphism
• Protected Variation
• Pure Fabrication
Enterprise App Sample Using GRASP