Upgrade to Pro — share decks privately, control downloads, hide ads and more …

AngularJS in Patterns, lightning talk

Minko Gechev
February 25, 2015

AngularJS in Patterns, lightning talk

Minko Gechev

February 25, 2015
Tweet

More Decks by Minko Gechev

Other Decks in Programming

Transcript

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

    View full-size slide

  2. Second lightning talk in English…

    View full-size slide

  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

    View full-size slide

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

    View full-size slide

  5. What is “AngularJS in Patterns?”

    View full-size slide

  6. “An academic paper, which introduces
    AngularJS in terms of already known concepts
    such as design and architectural patterns”

    View full-size slide

  7. Or basically…

    View full-size slide

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

    View full-size slide

  9. …which lives @ GitHub

    View full-size slide

  10. Why talking about this?

    View full-size slide

  11. Why that approach?

    View full-size slide

  12. New frameworks almost every day!

    View full-size slide

  13. Impossible to stay up to date
    by learning everything from
    scratch

    View full-size slide

  14. What is a development
    framework?

    View full-size slide

  15. –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.”

    View full-size slide

  16. In other words - generic
    architecture of a web
    application

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  19. As software developers we already
    know most of the frameworks by being
    aware of the traditional design and
    architectural patterns

    View full-size slide

  20. When I get frustrated, I
    open the GoF book and be
    awesome instead!

    View full-size slide

  21. “AngularJS in Patterns” just
    fills the gaps

    View full-size slide

  22. A few patterns

    View full-size slide

  23. –Gang of Four
    “Chain of Responsibility”

    View full-size slide

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

    View full-size slide

  25. $scope ($broadcast, $emit)

    View full-size slide

  26. –Gang of Four
    “Observer”

    View full-size slide

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

    View full-size slide

  28. $scope ($on, $broadcast/$emit)

    View full-size slide

  29. –Martin Fowler
    “Active Record”

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  32. Thank you!
    speakerdeck.com/mgechev
    github.com/mgechev
    twitter.com/mgechev

    View full-size slide