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

Zombieapps

 Zombieapps

We, programmers, are responsible for the architecture of the software we build. But, usually, we let others decide how we structure our systems.

Our applications solve a problem following the rules of a domain. Our
main task is building a software model of that domain. That model is the core, the soul of our system, and we usually sell it to the highest bidder.

In this talk I'll talk about domain models. We will discuss the the part they should play in our application and how its presence benefits the practices that, we, XP practitioners, love.

This talk is in Spanish and was given during XPDay 2013 in Madrid.

Javier Acero

April 23, 2013
Tweet

More Decks by Javier Acero

Other Decks in Programming

Transcript

  1. ZOMBIEAPPS
    Javier Acero
    jacegu
    jacegu
    javieracero.com

    View Slide

  2. View Slide

  3. 1
    2
    3
    BUSINESS LOGIC
    DATA SOURCES
    PRESENTATION

    View Slide

  4. 1
    2
    3
    Busine
    Logic

    View Slide

  5. Business Logic is a non-technical term
    generally used to describe the functional
    algorithms that handle information exchange
    between a database and a user interface.
    - Wikipedia

    View Slide

  6. Business Logic is a non-technical term
    generally used to describe the functional
    algorithms that handle information exchange
    between a database and a user interface.
    - Wikipedia
    oh boy...

    View Slide

  7. - Martin Fowler, Patterns of Enterprise Application Architecture
    Business Logic is the work the application
    needs to do for the domain it’s working with.

    View Slide

  8. CALCULATIONS VALIDATIONS
    CALLS TO EXTERNAL SYSTEMS
    +
    + =
    BUSINESS LOGIC

    View Slide

  9. SCRIPT
    TRANSACTION

    View Slide

  10. TRANSACTIONS
    busine logic a

    View Slide

  11. PROCEDURES
    modeled a
    def newPurchase()
    DB.insert();
    commit();
    end

    View Slide

  12. simple
    easy to understand
    works great with simple datasources
    makes transaction boundaries visible
    00
    {
    ADVANTAGES

    View Slide

  13. 00
    {duplicated code procedural code
    duplicated code procedural code
    duplicated code procedural code
    duplicated code procedural code
    ADVANTAGES
    DIS

    View Slide

  14. duplicated code
    get wo e a the a lication gro
    time

    View Slide

  15. MODULE
    TABLE

    View Slide

  16. OPERATIONS
    busine logic a
    TABLE ROWS
    on

    View Slide

  17. OBJECTS
    modeled a
    class Product {
    def purchase();
    recordSets();
    RECORD SETS
    &
    class RecordSet {

    View Slide

  18. avoids duplication better than a
    transaction script
    00
    {
    ADVANTAGES
    helps overcoming the relational - oo
    mismatch

    View Slide

  19. 00
    {
    ADVANTAGES
    DIS
    modeling limited by and tied to the
    data model
    mechanisms basic to OOP like
    polymorphism are not available

    View Slide

  20. MODEL
    DOMAIN

    View Slide

  21. OBJECT
    busine logic a
    BEHAVIOUR

    View Slide

  22. OBJECT GRAPHS
    modeled a
    Product
    Price
    Stock
    ProductService
    ProductRepository

    View Slide

  23. - Martin Fowler, Patterns of Enterprise Application Architecture
    The Object Oriented way of
    implementing business logic.

    View Slide

  24. ADVANTAGES
    - Martin Fowler, Patterns of Enterprise Application Architecture
    The Object Oriented way of
    implementing business logic.

    View Slide

  25. 00
    {the hardest to comprehend
    data sources get more complex
    overhead for simple business logic
    ADVANTAGES
    DIS

    View Slide

  26. effort to enhance
    complexity of the business logic
    domain model
    table module
    transaction script

    View Slide

  27. effort to enhance
    complexity of the business logic
    domain model
    table module
    transaction script
    7.42

    View Slide

  28. Programming
    What about...
    eXtreme

    View Slide

  29. OOP
    SOLID DESIGN PATTERNS REFACTORING

    View Slide

  30. UBIQUITOUS
    LANGUAGE

    View Slide

  31. .........F......
    ................
    .....TESTING.....
    ......F.........
    ....**...F..F...

    View Slide

  32. ANEMIC
    antipa ern
    DOMAIN
    MODEL

    View Slide

  33. antipa ern
    DOMAIN
    MODEL
    DRIVEN
    TABLE

    View Slide

  34. View Slide

  35. antipa ern
    DOMAIN
    MODEL
    CONNECTED

    View Slide

  36. View Slide

  37. DOMAIN MODEL
    BUILD
    Ho t ...
    A RICH

    View Slide

  38. BBBBRRRRR
    RAAAAIIILS

    View Slide

  39. Thank You

    View Slide

  40. QUESTIONS?

    View Slide

  41. The icons and images used in this
    presentation were found using Google and
    belong to their respective authors.
    The Database Slide was taken from
    @unclebob’s talk at Ruby Midwest 2011
    Credit

    View Slide

  42. Here is where I found them:
    Credit
    Spaghetti: http://goo.gl/KrGiL
    Zombie 1: http://goo.gl/mHiYe
    Zombie 2: http://goo.gl/hk8i0
    Zombie Apocalypse: http://goo.gl/7IIK6
    Tool: http://goo.gl/75Svb

    View Slide