Git Product home page Git Product logo

jpmorgan.supersimplestocks's Introduction

JPMorgan.SuperSimpleStocks

Solution is developed in the Visual Studio 2015. In addition to using C# .Net, Following frameworks are used.

  • NUnit 3
  • Moq
  • FluentAssertion

Solution structure

This solution contains three projects. README file is in the Solution Items folder.

  • JPMorgan.SuperSimpleStocks.Domain
    Project contains domain logic classes to implement the requirenments.
  • JPMorgan.SuperSimpleStocks.Domain.UnitTest
    Unit test project for the Domain project classes. To run these unit tests NUnit Test Adapter 3.6 is required which can be added to the visual studio.
  • JPMorgan.SuperSimpleStocks.GBCExchangeApi
    This is a basic api for providing interface to run all the required methods. You can use web browser or any application like postman to call methods in this webapi. Postman can be downloaded or added as chrome extension.

Design decisions.

  • Repositories:
    This project folder contains classes for Repository pattern, which is used for storing stocks and trades in memory. If in future we need to record in a file or database we can extend IStockRespository and ITradeRespository interfaces.

  • Stock:
    Project folder contains classes for Stocks. Stock is an Abstract class which implements IStock interface, it contains PERatio method. Classes StockCommon and StockPreferred are derived from this abstract class.
    These derived classes then implements DividendYield abstract method by overriding the base class abstract method with using respective dividend yield formula for preferred and common stock.

  • Trade
    Project folder contains ITrade interface and its implementation Trade class which contains properties to describe trade. This class contains no method as use cases didn't identified any.
    Method VolumeWeightedStockPrice seems more suitable to put outside in a service class called Trading.

  • StockExchange
    This class is more like a service class which have following public methods.

	AddStock
	GetDividendYield
	GetPERatio
	GetAllShareIndex
  • Trading
    This class is also more like a service class which have following public methods.
AddTrade
GetVolumeWeightedStockPrice (By default price is based on trades in past 15 minutes.)
  • Validation This class contains methods for validation, throws exceptions if valid parameters is not passed to the method in which these validation methods are being called.
  • Enums This contains enum for TradeType.

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.