Code Monkey home page Code Monkey logo

pharmmanager's People

Contributors

kungpaojake avatar maxfarnham avatar justodiaz avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pharmmanager's Issues

Presentation layer refactoring

There's a smattering of code like this in the codebase:

public void update() {
        System.out.println("Daily alerts for stock on " + getName() + ":");
        Iterator bulkIterator = createIterator();
[...]

We need to refactor this so all presentation code is handled centrally, without any business logic around it, or it will be very difficult to add a GUI later.

Database table designs

Just wondering what you guys have in mind for tables/names/fields for our database. So far I have this one:

medicine: (int) medicineID, (string) name, (int) lowThreshold, (int) overThreshold, (string) size

Let me know if you want any additional tables and/or want to change the current table (as I see size can be an int depending on our implementation)

Datalayer refactoring

Anywhere we have the PharmacyManager directly accessing the meds list, we need to pull that out into a SQL statement that accesses the datalayer. I think my original design for the datalayer is a bit off, as we discussed tonight, and we should just need three functions:

executeUpdate(string SQL)
executeQuery(string SQL)
executeScalar(string SQL)

So with that in mind, basically anywhere we have stuff like:

meds.add(newMed);

We need to replace it with something like:

DB.executeUpdate("INSERT INTO Meds(Blah, Blah) VALUES('Bloo','Bloo')

We can also discuss the table structure here, I like Justo's separation of Medicine and "Bulks" (should we maybe call them shipments?), similar to what we did. So the meds table would look something like:

MedicineID Name LowStockThreshold OverstockThreshold
int string int int

The bulk/shipment table would look like:

ShipmentID Sold Expired InStock ExpDate MedicineID
int int int int DateTime int

Any thoughts on any of this?

Factory vs Template

@justodiaz, do we need the factory in here? I think the factory is unnecessary and doesn't really add any value. We were thinking of using the template pattern instead, in the observables, which may fit more naturally into our problem.

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.