1 / 29

eu ropean con ference

eu ropean con ference. Design patterns with Spring4D. About me. Primož Gabrijelčič http://primoz.gabrijelcic.org p rogrammer , MVP, writer , blogger , consultant , speaker Blog http://thedelphigeek.com Twitter @ thedelphigeek Skype gabr42 LinkedIn gabr42 GitHub gabr42.

khealy
Download Presentation

eu ropean con ference

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. europeanconference

  2. Design patterns with Spring4D

  3. About me Primož Gabrijelčič http://primoz.gabrijelcic.org • programmer, MVP, writer, blogger, consultant, speaker • Blog http://thedelphigeek.com • Twitter @thedelphigeek • Skype gabr42 • LinkedIn gabr42 • GitHub gabr42

  4. Hands-on Design Patterns with Delphi • Packt Publishing • www.packtpub.com • http://tiny.cc/pg-dpd

  5. My other books http://tiny.cc/pg-ppotl http://tiny.cc/pg-dhp

  6. Design patterns

  7. Design patterns • Pattern = template for a solution • Pattern = common vocabulary • Pattern ≠ recipe • architectural patterns > design patterns > idioms • design patterns ≠ design principles (SOLID, DRY …) • https://en.wikipedia.org/wiki/Software_design_pattern

  8. Categories • Creational patterns: delegation • Creating objects and groups of objects • Structural patterns: aggregation • Define ways to compose objects • Behavioral patterns: communication • Define responsibilities between objects • Concurrency patterns: cooperation • Make multiple components work together

  9. Patterns and Spring4D

  10. Creational patterns Pattern Spring4D TSingleton Spring.Container … Lazy TFactoryMethod, TFactory • Singleton • Dependency injection • Lazy initialization • Factory method

  11. Structural patterns Pattern Spring4D Shared, Spring.Interception, Mock Spring.Reflection • Proxy • (Marker interface)

  12. Behavioral patterns Pattern Spring4D IEnumerable, Spring.Collections TObservable, Event TSpecification • Iterator • Observer • Specification

  13. Concurrency patterns Pattern Spring4D TLazyInitializer • Optimistic initialization

  14. Creational patterns https://en.wikipedia.org/wiki/Creational_pattern

  15. Singleton • “Ensures that a class has only one instance.” • TSingleton • Spring.DesignPatterns • Lazy initialization • https://en.wikipedia.org/wiki/Singleton_pattern

  16. Dependencyinjection • “Put appropriate instances in; don’t let the object create them.” ⇒Dependency injection • https://en.wikipedia.org/wiki/Dependency_injection

  17. Lazy initialization • “Delays the creation of an object until it is actually needed.” • ILazy, ILazy<T>, TLazy, TLazy<T>, Lazy<T> • Spring • https://en.wikipedia.org/wiki/Lazy_initialization

  18. Factory method • “An interface for creating a single object.” • TFactoryMethod<T>, TFactory<T> • Spring.DesignPatterns ⇒Dependency injection • https://en.wikipedia.org/wiki/Factory_method_pattern

  19. Structural patterns https://en.wikipedia.org/wiki/Structural_pattern

  20. Proxy • “Provides a replacement for another object so it can control access to the object.” • IShared<T>, Shared<T>, Shared • Spring • Spring.Interception, Mock<T> ⇒Interception and dynamic proxy • https://en.wikipedia.org/wiki/Proxy_pattern

  21. Marker interface • “Allows us to associate metadata with a class.” • HasCustomAttribute<T>, GetCustomAttribute<T> • Spring.Reflection • https://en.wikipedia.org/wiki/Marker_interface_pattern

  22. Behavioral patterns https://en.wikipedia.org/wiki/Behavioral_pattern

  23. Iterator • “Provides a way to access elements of an aggregate object without exposing the underlying implementation.” • IEnumerable • Spring.Collections ⇒Collections • https://en.wikipedia.org/wiki/Iterator_pattern

  24. Observer[Publish-Subscribe] • “A system where a change of objects results in all of its dependents being notified about the change.” • IObservable<T>, TObservable<T> • Spring.DesignPatterns • IEvent, IEvent<T>, Event<T>, INotifyEvent, INotifyEvent<T> • Spring • https://en.wikipedia.org/wiki/Observer_pattern

  25. Specification • “Allows business rules to be recombined by chaining them together using boolean logic.” • ISpecification<T>, TSpecification<T> • Spring.DesignPatterns • https://en.wikipedia.org/wiki/Specification_pattern

  26. Concurrency patterns https://en.wikipedia.org/wiki/Concurrency_pattern

  27. Optimistic initialization • Lazy initialization • TLazyInitializer • Spring • https://en.wikipedia.org/wiki/Lock_(computer_science)

  28. Design pattern pitfalls

  29. Pattern problems • Using patterns to architect the software • Blindly applying patterns • Blindly copying C++/Java implementations • Design patterns are a tool, not a goal!

More Related