Giter Club home page Giter Club logo

unisinos-devii-chain-responsibility's Introduction

Design Pattern - Chain of Responsibility

Description

The main goal of this exercise was to understand the pattern chosen and create a practical example.

So, we used the Chain of Responsibility that contemplates a chain where each part is responsible for maintaining operation. When a request coming from the client, it will pass for this chain - e.g. client request send an e-mail so will be examined and execute in one of the steps.

To better exemplify, below we show a diagram of how this is working.

General example

The code

We did a simple code that show what happens when it's buying a product and applied different discounts.

Check here the code and UML: Apply different discounts code

Technical problems and solutions

I had problems to organizer the code in folders. My tests were put in subfolders, so when I tried to do an import from a parent folder or another folder, I received this error:

    ModuleNotFoundError: No module named [name file]

To resolve I used to bash and type this command on root folder:

    export PYTHONPATH="$PWD"

Some refs.: scratch file

unisinos-devii-chain-responsibility's People

Contributors

gabcastro avatar

Watchers

 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.