useful design patterns for enterprise applications with java
Post on 07-Jan-2017
1.029 Views
Preview:
TRANSCRIPT
USING GRASP IN ENTERPRISE APPS
Enhancing Human Capacity
Agenda
• ShineTech and Workshop for OCA Course Promotion
• GRASP in Enterprise Apps
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?
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?
II – GRASP in Enterprise Apps
• Defines who creates an Object or instance of class
• Factories podem ser usadas usando SingleTons
Creator
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
IV – GRASP in Enterprise Apps
• Reduces the dependency between objects
• Improve maintenance and component reuse
• Using interfaces helps decoupling
Low Coupling
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
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
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
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
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
X – GRASP in Enterprise Apps
• Pattern to avoid the elements variations (changes) in
other elements
• Examples:
• Data encapsulation (private attributes)
• Interfaces
Protected Variation
XI – GRASP in Enterprise Apps
• Creator
• Information Expert
• Low Coupling
• Controller
• High Cohesion
• Indirection
• Polymorphism
• Protected Variation
• Pure Fabrication
Enterprise App Sample Using GRASP
Perguntas?
Agradecimento
• Referência: Craig Lairman
• Applying UML and Patterns
• Presentes
• Especial para:
• O PTJUG
top related