Chapter 4 - Design Patterns
Chapter 4 - Design Patterns
Chapter 4 - Design Patterns
Software Engineering
MedTech
MedTech
MedTech
• Design patterns:
• Provide general solutions, documented in a format that doesn’t require
specifics tied to a particular problem
• Can speed up the development process by providing tested, proven
development paradigms
• Help you benefit from the experience of fellow developers
• Prevent subtle issues that can cause major problems
• Improve code readability for coders and architects familiar with them
MedTech
MedTech
MedTech
CREATIONAL PATTERNS
MedTech
• Examples:
• Factory
• Singleton
• Builder
• Prototype
MedTech
MedTech
MedTech
MedTech
• Common Usage
• factories providing an xml parser:
• javax.xml.parsers.DocumentBuilderFactory
• javax.xml.parsers.SAXParserFactory
• java.net.URLConnection
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
STRUCTURAL PATTERNS
MedTech
• Structural patterns are concerned with how classes and objects are
composed to form larger structures.
• Structural class patterns use inheritance to compose interfaces or
implementations.
• Structural object patterns describe ways to compose objects to realize new
functionality. The added flexibility of object composition comes from the ability
to change the composition at runtime, which is impossible with static class
composition.
• Examples:
• Adapter
• Proxy
• Bridge
• Composite
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
BEHAVIORAL PATTERNS
MedTech
• Examples:
• Command
• Iterator
• Observer
• Strategy
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
MedTech
• Textbooks
• E. Gamma & al. Design Patterns: Elements of Reusable Object-Oriented
Software , Addison-Wesley, 1994
• B. Christiansson & al. GoF Design Patterns -with examples using Java and
UML2 , 2008
MedTech