Git Product home page Git Product logo

yasasmahima / zone24x7-technical-induction-session Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 1.41 MB

Writing of the sample application without SOLID principles (Calculator APP) and discuss possible issues which could occur - Coupling and Cohesion. Then Applying SOLID principles to sample application and re-write the sample application. Finally doing Exception handling and logging best practices and Unit testing

Java 100.00%
zone24x7 java testdrivendevlopment maven

zone24x7-technical-induction-session's People

Contributors

yasasmahima avatar

Watchers

 avatar  avatar

zone24x7-technical-induction-session's Issues

Possible ISP correction

ISP problem correction

This is issue was created as an University assignment, therefore feel free to delete/ignore it

Permalink

System.out.println("Result is : " +(numberList.get(0) + numberList.get(1)));

Solution

SimpleLogger defines the behavior for logging information
Logger implements the interface, and defines how and where should the information be logged

UML

image

Source Code

SimpleLogger

image

Logger

image

Possible OCP problem correction

OCP problem correction

This is issue was created as an University assignment, therefore feel free to delete/ignore it

Issue permalink

Solution

Each mathematical operation implements the Computable Interfce, and defined how should it's result be computed, this allows easy extension of the code-base.

UML

image

Source Code

Computable interface

image

Addition class

image

Subtraction class

image

Multiplication class

image

Division class

image

Possible SRP problem correction

SRP problem correction

This is issue was created as an University assignment, therefore feel free to delete/ignore it

Error permalink

List<String> lines = Files.readAllLines(Paths.get("D:\\Zone24x7\\Java_test\\src\\main\\java\\number"));

UML

image

  1. The interface Computable Computes the output
  2. The class OperationFactory selects which operation must be runned
  3. The interface SimpleRepository is used to extract data from file.
  4. The interface SimpleLogger is responsible of showing the output to the use

Source Code

Computable interface

image

SimpleLogger interface

image

OperationFactory class

image

SimpleRepository interface

image

Possible ISP problem

ISP problem correction

This is issue was created as an University assignment, therefore feel free to delete/ignore it

Permalink

Solution

Each mathematical operation implements the Computable Interfce, and defined how should it's result be computed, this allows easy extension of the code-base.

UML

image

Source Code

Computable interface

image

Addition class

image

Subtraction class

image

Multiplication class

image

Division class

image

Possible ISP correction

ISP problem correction

This is issue was created as an University assignment, therefore feel free to delete/ignore it

Permalink

List<String> lines = Files.readAllLines(Paths.get("D:\\Zone24x7\\Java_test\\src\\main\\java\\number"));

Solution

SimpleRepository defines behavior for data extraction.
FileBasedRepository implements how the information is read from the file, and what file to read ti from.

UML

image

Source Code

SimpleRepository

image

FileBasedRepository

image

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.