AngularJS in Patterns, lightning talk

82bafb0432ce4ccc9dcc26f94d5fe5bc?s=47 Minko Gechev
February 25, 2015

AngularJS in Patterns, lightning talk

82bafb0432ce4ccc9dcc26f94d5fe5bc?s=128

Minko Gechev

February 25, 2015
Tweet

Transcript

  1. AngularJS in Patterns Minko Gechev github.com/mgechev twitter.com/mgechev

  2. Second lightning talk in English…

  3. Minko Gechev [ "Freelance software developer", “Assistant Professor at Sofia

    University", { "Open Source Advocate": [ "AngularJS Style Guide", "AngularAOP", "plainvm", "angular-webrtc", "a bunch of deprecated software" ], "Currently": [ "Based in San Mateo, California", "Works with LearnCapital" ] }, "SofiaJS & BeerJS, Bulgaria" ] github.com/mgechev twitter.com/mgechev
  4. Content • What is “AngularJS in Patterns?” • Why talking

    about this? • Why that approach? • A few patterns
  5. What is “AngularJS in Patterns?”

  6. “An academic paper, which introduces AngularJS in terms of already

    known concepts such as design and architectural patterns”
  7. Or basically…

  8. A lot of text with only a few pictures and

    code snippets…
  9. …which lives @ GitHub

  10. Why talking about this?

  11. None
  12. Why that approach?

  13. New frameworks almost every day!

  14. None
  15. None
  16. Impossible to stay up to date by learning everything from

    scratch
  17. What is a development framework?

  18. –docs.angularjs.org “Framework - a particular implementation of a web application,

    where your code fills in the details. The framework is in charge and it calls into your code when it needs something app specific. E.g., angularjs, knockout, ember, etc.”
  19. In other words - generic architecture of a web application

  20. Each developer must have… • Software engineering skills, including: •

    Software development principles (GRASP, SOLID, etc.) • Software design & architectural patterns • Computer Science skills, including: • Complexity analysis • Algorithms and data structures
  21. Each developer must have… • Software engineering skills, including: •

    Software development principles (GRASP, SOLID, etc.) • Software design & architectural patterns • Computer Science skills, including: • Complexity analysis • Algorithms and data structures
  22. As software developers we already know most of the frameworks

    by being aware of the traditional design and architectural patterns
  23. When I get frustrated, I open the GoF book and

    be awesome instead!
  24. “AngularJS in Patterns” just fills the gaps

  25. A few patterns

  26. –Gang of Four “Chain of Responsibility”

  27. The chain-of-responsibility pattern is a design pattern consisting of a

    source of command objects and a series of processing objects. Each processing object contains logic that defines the types of command objects that it can handle; the rest are passed to the next processing object in the chain.
  28. $scope ($broadcast, $emit)

  29. –Gang of Four “Observer”

  30. The observer pattern is a software design pattern in which

    an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods.
  31. $scope ($on, $broadcast/$emit)

  32. –Martin Fowler “Active Record”

  33. The Active Record object is an object, which carries both

    data and behavior. Usually most of the data in these objects is persistent, responsibility of the Active Record object is to take care of the communication with the database in order to create, update, retrieve or delete the data. It may delegate this responsibility to lower level objects but calls to instance or static methods of the active record object cause the database communication.
  34. $resource

  35. References • AngularJS Inheritance Patterns • The magic of $resource

    (or simply a client-side Active Record) • AngularJS in Patterns • Patterns of Enterprise Application Architecture • Design Patterns: Elements of Reusable Object- Oriented Software
  36. Thank you! speakerdeck.com/mgechev github.com/mgechev twitter.com/mgechev