HalgrimThadeus / long-read-microbiome

2018 programming project
5 stars 0 forks source link

Refactoring and update Changes #39

Open manuelgloeckler opened 6 years ago

manuelgloeckler commented 6 years ago

Refactorings:

canerbagci commented 6 years ago

NAMING

DESIGN

FILTER GIT

I will add more as you change. First implement some logic and I'll see how it goes. Email/respond to the issue or drop by our office if anything is unclear.

canerbagci commented 6 years ago

To make it more clear; I think if you implement main Model/View/Presenter classes and restrict the interaction between layers to these 3 main classes, you'll make it much easier. Right now the organization is just too messy. It's fine to have multiple Presenter classes, and you must have multiple Model and View classes anyway. But please try to organize them in "more abstract" classes.

e.g.

class Presenter -> gets initialized in Main/View. the constructor initializes FilterPresenter, MainTabPresenter, SamplePresenter etc. It know about the View and Model classes. Communicates with the View class, binds to objects in Model.

class View -> You already have this...

class Model (Project) -> It can be the Project class. Holds everything a project has (samples, filters etc). Presenter only binds to objects/properties of objects in this class. So, the presenter only knows about this class.

canerbagci commented 6 years ago

For GUI elements, instead of setting length, width, x, y coordinates etc (basically any property); please use bindings. For example (@manumanu12345), when you create rectangles in your chart, instead of doing newSequence.setHeight(BAR_WIDTH); do newSequence.heightProperty().bind(BAR_WIDTH_PROPERTY). For this to work, you need to change the BAR_WIDTH to IntegerProperty. This will make the height of rectangles to change whenever the value of BAR_WIDTH changes; without you having to do anything additional. Properties are observables and when you bind them, JavaFX observers them by default.