1 / 13

About patterns

About patterns. Outline What’s a pattern? An example from fast food Comments on the “definition” Patterns and software development culture Pattern definition exercises. What’s a pattern?. Alexander’s characterization (quoted by Fowler) Recurring problem Environment in which it occurs

samara
Télécharger la présentation

About patterns

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. About patterns Outline • What’s a pattern? • An example from fast food • Comments on the “definition” • Patterns and software development culture • Pattern definition exercises Pattern-Oriented Cluster: Comp 630/650/655

  2. What’s a pattern? Alexander’s characterization (quoted by Fowler) • Recurring problem • Environment in which it occurs • Core of a solution • Has been used successfully multiple times • Can be used many times without ever doing it the same way twice Pattern-Oriented Cluster: Comp 630/650/655

  3. Example: fast food pattern • Problem: people getting burned on hot drinks • Environment: fast food restaurants • Solution: print warnings on packaging • Name: Achtung - Heiss Pattern-Oriented Cluster: Comp 630/650/655

  4. Other solutions • Solution: make in advance, heat to safe temperature when serving • Name: Heat-n-Serve • Solution: make drinks at safe temperatures • Name: Low-Temperature Recipe Pattern-Oriented Cluster: Comp 630/650/655

  5. What’s the real problem? • Heat-n-Serve and Low-Temperature Recipe are about preventing burns • Achtung-Heiss is about preventing lawsuits Pattern-Oriented Cluster: Comp 630/650/655

  6. Definition vs Characterization Definition: Duck • Any of numerous relatively small and short-necked web-footed swimming birds of the family Anatidae. Characterization: Duck • Walk: waddle • Sound: quack Patterns characterize more than they define Pattern-Oriented Cluster: Comp 630/650/655

  7. Comments on the characterization • Patterns have consequences • Some patterns go together Class Table Inheritance (285) usually implies Domain Model (116) • Using a pattern can introduce other problems Developers often have trouble getting comfortable with Domain Model (116) • Architecture patterns differ from GOF • It’s all Indirection … Pattern-Oriented Cluster: Comp 630/650/655

  8. Patterns and software culture • At best: gray heads use patterns to help younger people without being dogmatic • At worst: pattern writers kill lots of trees • At best: patterns make communication more efficient • Huffman codes for architecture/design descriptions • Can save effort in project design documentation • At worst: patterns add confusion • People may have different understandings of a pattern Pattern-Oriented Cluster: Comp 630/650/655

  9. More on patterns and culture • Naming patterns is • Really important • Really hard • Patterns are owned by the community • Nobody invents patterns • You can’t patent a pattern • Patterns are “identified” or “discovered” • Pattern writers depend on feedback • Especially about naming, applicability, consequences Pattern-Oriented Cluster: Comp 630/650/655

  10. One more comment … • The analogy between building architecture and software architecture • Can be helpful • Can be over-used Pattern-Oriented Cluster: Comp 630/650/655

  11. Pattern definition exercises • Environment given, or picked as first step • Brainstorm recurring problems in the environment • Pick a recurring problem to work on • Identify the core of a solution • Not (on purpose) a Fowler pattern • Pick a name • Present to the class Pattern-Oriented Cluster: Comp 630/650/655

  12. Pattern exercise 1 • Environment: group project • Note: this is not necessarily a software project Pattern-Oriented Cluster: Comp 630/650/655

  13. Pattern exercise 2 • This one is about software • Environments to choose from: • Database • Web presentation • Performance/capacity • Source code control/configuration management • Or, brainstorm some other environment Pattern-Oriented Cluster: Comp 630/650/655

More Related