GithubHelp home page GithubHelp logo

plopezgit / sprint3_t2_patterns_part_2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 39 KB

Design pattern study

Home Page: https://refactoring.guru/design-patterns

Java 100.00%
callback dependency-injection design-patterns observer-pattern

sprint3_t2_patterns_part_2's Introduction

Sprint3_T1_Patterns_Part_2

  • Level 1

In all exercises, create a Gradle project with a Main class that demonstrates the use of the pattern (with any invocations that are needed).

observe

Design a system in which a Stock Exchange Agent (Observable) notifies several Stock Exchange agencies (Observers) of changes when the Stock Exchange goes up or down.

It is necessary for the Observable object to hold references to the Observers.

  • Level 2

Callback

Simulates a payment gateway that receives an object encapsulating the payment method to be made: credit card, Paypal or bank account debt.

The gateway will invoke the payment without knowing the form and returning control to the parent class. The class that invokes the payment gateway will be a shoe store.

  • Level 3

Dependency Injection

Design a class that displays the price of various items on the screen. Since you will have to show them in several types of currency as well.

Important

Make sure to add as a Dependency Injection a CurrencyConverter class that performs the price correction based on the currency exchange.

sprint3_t2_patterns_part_2's People

Contributors

plopezgit avatar

Watchers

 avatar

sprint3_t2_patterns_part_2's Issues

makes callback pattern demostration on main

ShoesShop shop = new ShoesShop();
	System.out.println(shop.executePayment(200, 1));
	System.out.println(shop.executePayment(200, 2));
	System.out.println(shop.executePayment(200, 3));

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.