Code Monkey home page Code Monkey logo

ubb.dp.1819's Introduction

ubb.dp.1819

UBB Design Patterns repository for university year 2018-2019

Lab 1

Prerequisites:

Ex. 1.1. Encapsulation

We will want to read information from a file and interpret this information via a Service. Using the Single-Responsibility principle from SOLID, please create 2 Services:

  • The first Service reads a file and returns all lines in the file in a List of Strings

  • The second Service interprets this data as coffee ingredients

-- a line containing only 3 or 4 words is a valid ingredients line. Fewer or more words are invalid.

-- of the 3 or 4 words:

--- one should be a quantity (200)

--- one should be a unit (ml)

--- one should be an ingredient (milk)

--- the last one is optional and should be an adjective (boiled, steamed, roasted, etc.)

Ex. 1.2. Coffee Factory

Create a Coffee Service implementation to return an identified coffee type depending on the ingredients given as input

The list of possible coffee types:

  • espresso: 2 cups water + 0.25 cups coffee-beans roasted
  • cappuccino: 2 cups water + 0.25 cups coffee-beans roasted + 100ml foamed milk
  • americano: 4 cups water + 0.25 cups coffee-beans roasted
  • add a coffee of your choosing with name and ingredients

Ex. 1.3. Coffee Builder

Encapsulate the creation of the coffee with each line of ingredients with a builder.

ubb.dp.1819's People

Watchers

Denis Fovas 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.