Git Product home page Git Product logo

remocalc's Introduction

RemoCalc - A remote Calculator with CLI Client Application

General Information

This remote calculator provides a calculator accessible as a SOAP web service. The web-service is referred to as calculation-service. It is accompanied by a cli-client that can be used to interact with the calculation-service. To get started, you have to first build the project, then deploy the web-service before you can use the cli-client.

Assumptions

To better understand the design choices I made I am going to give a rough outline of the most important assumptions I made:\

  1. The web service should be easily accessible to developers that do not know anything about the exact implementation (-> well known protocol is needed)
  2. Calculations can are not limited to one mathematical operator per calculation, rather they can be arbitrarily long/complex
  3. The calculator is used for calculations that are depictable with values of the double datatype.

Capabilities

The calculator can handle calculations involving the following mathematical operators:

+-*\

Decimal numbers are expressed with a dot.
It is possible to chain an arbitrary number of calculations, e.g.: 500+3*-29+400/-3*5+6000

Tested environment

All the provided instructions and the application were tested on a machine running GNU/Linux with the following software versions:
java 11 maven 3.8.6 docker 20.10.17

How to build the project

The project is build via maven. To build the server-side project run the following command from the projects root directory:

mvn -pl '!cli-client' clean install

(on Windows you might have to use " instead of ')

The cli-client can only be build once the calculation-service is running since it creates the sources for the SOAP endpoint during the maven build process, which necessitates that the service is running at that time.

The cli-client is build by running the following command from the cli-client directory, while the calculation-service is running:

mvn clean install

Deploying the calculation-service

The calculation service can be deployed either directly on the host operating system, or via a provided Docker Container.

Deploying directly on the OS

Run the following command from the projects root directory:

java -jar calculation-service/target/calculation-service-1.0-SNAPSHOT.jar

Deploying as a Docker Container

To deploy the service as a docker container, the container image has to be build first by running the following command from the projects root directory:

docker build -t example/calculation-service:1.0.0 ./calculation-service/.

To run the container execute the following command:

docker run -p 8080:8080 example/calculation-service:1.0.0

Running the cli-client

After building the cli-client module you have two options to use the cli-client application. Either you run it with the calculation you want to solve as argument, or you run it without arguments to enter a session where you can directly enter and solve as many successive calculations as you want.
To run the client with the calculation as argument, run the following from the projects root directory (modify the calculation to fit whatever calculation you want to solve):

java -jar cli-client/target/cli-client-1.0-SNAPSHOT.jar "500+3*-29+400/-3*5+6000"

To enter a session run the application without arguments:

java -jar cli-client/target/cli-client-1.0-SNAPSHOT.jar

remocalc's People

Contributors

daniel-gomm 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.