Common Design Patterns       Steve Smith       @ardalis | ardalis.com       Telerikhttp://flic.kr/p/4MEeVn
http://flic.kr/p/8XgqKu
http://flic.kr/p/6StgW5
http://flic.kr/p/6UpMt9
http://geekandpoke.typepad.com/geekandpoke/2011/04/design-patterns-are-still-useful.html
Actual Usage   http://twtpoll.com/r/t7jzrx
(Of course there are many others!)


Source: http://csharpindepth.com/Articles/General/Singleton.aspx
                   Shameless Plug:           But why would you            Telerik JustMock can be        intentional...
http://flic.kr/p/6spkwo
            

        
“new” creates tight coupling                         between classeshttp://flic.kr/p/aN4Zv
                    
Compile Time          Runtime        User Interface                          Database
Compile Time        Runtime    User Interface     Helper Class      Database
Compile Time                                Runtime                   User Interface           Core              Infras...
                
            

http://flic.kr/p/5Yb5i
            
               Pending    Archived             Published
http://flic.kr/p/vGpC2
                    

Design Patterns in ActionCODE
    

Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Common design patterns (migang 16 May 2012)
Upcoming SlideShare
Loading in...5
×

Common design patterns (migang 16 May 2012)

3,042

Published on

A discussion of six common design patterns, when to use them, how they are implemented, and when to avoid them.

0 Comments
12 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,042
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
94
Comments
0
Likes
12
Embeds 0
No embeds

No notes for slide
  • General, reusable solutions to common problemsNot a complete, finished solutionA template, recipe, or approach to solving certain problemsEach has a specific name, so we can discuss common elements of design using a common vocabulary
  • Learning anything – a musical chord, a martial arts technique, etc.Zero: You used a what? Never heard of it.Awakening:Wow, I just learned how XYZ pattern can improve my design. I’m not really sure where it would work in my code, but I’m definitely looking.Overzealous:I totally “get” the XYZ pattern; I’m adding it everywhere I can shoehorn it into my code. My design’s gonna be better now, for sure!Mastery: In response to some specific design pain points, the XYZ pattern was a logical next step and was achieved through a simple refactoring.
  • Design pattern names provide placeholders or complex abstractions and sets of refactorings. Consider the difference between:We have some tight coupling to the database here. We can probably fix it if we apply these refactorings;extract an interface, extract a method, Extract a class,Replace local with parameterORLet’s apply the Repository pattern to fix it.
  • It’s possible for the new Singleton(); line to be called more than once.
  • http://en.wikipedia.org/wiki/File:Proxy_concept_en.svg
  • Apply patterns via refactoring,Not Big Design Up Front
  • Common design patterns (migang 16 May 2012)

    1. 1. Common Design Patterns Steve Smith @ardalis | ardalis.com Telerikhttp://flic.kr/p/4MEeVn
    2. 2. http://flic.kr/p/8XgqKu
    3. 3. http://flic.kr/p/6StgW5
    4. 4. http://flic.kr/p/6UpMt9
    5. 5. http://geekandpoke.typepad.com/geekandpoke/2011/04/design-patterns-are-still-useful.html
    6. 6. Actual Usage http://twtpoll.com/r/t7jzrx
    7. 7. (Of course there are many others!)
    8. 8. 
    9. 9. 
    10. 10. Source: http://csharpindepth.com/Articles/General/Singleton.aspx
    11. 11.    Shameless Plug: But why would you  Telerik JustMock can be intentionally write code usedcan mocktest with you to only and test certainSingletons tools? premium 
    12. 12. http://flic.kr/p/6spkwo
    13. 13.    
    14. 14. 
    15. 15.   
    16. 16. “new” creates tight coupling between classeshttp://flic.kr/p/aN4Zv
    17. 17.      
    18. 18. Compile Time Runtime User Interface     Database
    19. 19. Compile Time Runtime User Interface Helper Class Database
    20. 20. Compile Time Runtime User Interface Core Infrastructure IFooRepository SqlFooRepository   Database
    21. 21.     
    22. 22.    
    23. 23. 
    24. 24. http://flic.kr/p/5Yb5i
    25. 25.    
    26. 26.  Pending Archived Published
    27. 27. http://flic.kr/p/vGpC2
    28. 28.      
    29. 29. 
    30. 30. Design Patterns in ActionCODE
    31. 31.  
    32. 32. 
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×