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 Slide

  2. Second lightning talk in English…

    View 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 Slide

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

    View Slide

  5. What is “AngularJS in Patterns?”

    View Slide

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

    View Slide

  7. Or basically…

    View Slide

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

    View Slide

  9. …which lives @ GitHub

    View Slide

  10. Why talking about this?

    View Slide

  11. View Slide

  12. Why that approach?

    View Slide

  13. New frameworks almost every day!

    View Slide

  14. View Slide

  15. View Slide

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

    View Slide

  17. What is a development
    framework?

    View Slide

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

    View Slide

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

    View Slide

  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

    View Slide

  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

    View Slide

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

    View Slide

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

    View Slide

  24. “AngularJS in Patterns” just
    fills the gaps

    View Slide

  25. A few patterns

    View Slide

  26. –Gang of Four
    “Chain of Responsibility”

    View Slide

  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.

    View Slide

  28. $scope ($broadcast, $emit)

    View Slide

  29. –Gang of Four
    “Observer”

    View Slide

  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.

    View Slide

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

    View Slide

  32. –Martin Fowler
    “Active Record”

    View Slide

  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.

    View Slide

  34. $resource

    View Slide

  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

    View Slide

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

    View Slide