Git Product home page Git Product logo

software-architecture-patterns's Introduction

Software Architectural Patterns

First, fork the repo!

Install:

  • composer install
  • composer run
  • Add an entry in your etc/hosts to redirect archi.local to your docker host IP (your machine or VM).
  • Go to http://archi.local, it should show a json list.

Run tests:

  • composer test

Foreword

This is a Silex application (built from the official Silex Skeleton with minor changes).

You'll find the Pimple dependency injection in app/app.php The controllers are mounted in app/controllers.php In app/ControllerProvider and app/ServiceProvider, you'll find the Silex tool classes for config.

All the domain code will go in src.

If you have any question, ask me.

What is it about?

For the following exercises, we'll play with pokemons. There's already some code working. You'll have to complete it. It will happen in 4 phases (or less if we run out of time). Do not TDD (workshop is too short).

Here, pokemon has been reduced to very simple features:

  • You can list your pokemons
  • You can get information on one pokemon of your collection
  • You can catch a pokemon (it will add a pokemon to your collection - ie. create it for simplification)
  • You can make a pokemon evolve

Max level for a pokemon is 30. Min level for a pokemon is 1. A pokemon can evolve when he has attained level 7 (but doesn't have to). A pokemon can evolve again when he has attained level 15. A pokemon cannot skip an evolution (carapuce can't evolve directly to tortank). There are only 150 pokemons (http://www.poketips.fr/liste/).

Phase 1:

Create a branch named transaction-script. Add the missing constraints to capture feature. Implement the evolve feature by following the Transaction Script pattern (code everything in the controller). Don't forget to keep it simple.

Phase 2:

Create a branch named n-layer (from master or transaction-script). Refactor the code to add a Service and a DataAccess layers. Start creating Model objects, but keep them simple.

Phase 3:

Create a branch named hexagonal (from master, transaction-script, or n-layer). Refactor the code to separate what's inside your domain (Business Model and ports) and what's outside (adapters). Put all your domain logic in the Business Model objects.

Phase 4:

For each of the previous branches, try to CQRS it.

software-architecture-patterns's People

Contributors

remi-san avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.