ZancaM / quantdesk

Automatically exported from code.google.com/p/quantdesk
0 stars 0 forks source link

Refactor to separate DataService from actual UI #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
To be detailed.

Original issue reported on code.google.com by Andrey.D...@gmail.com on 13 Jun 2010 at 4:13

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Amit, please look at the code and come up with suggestion: what's in your 
opinion is wrong (not so good) and what should be refactored and in what way.

Original comment by Andrey.D...@gmail.com on 14 Jun 2010 at 2:26

GoogleCodeExporter commented 8 years ago
ok..i will find 

Original comment by amit.ha...@gmail.com on 14 Jun 2010 at 2:31

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
One thing I do not want is for the ui to contact yahoo directly.
I want to have a local service which wil cache the data locally. 

Original comment by atra...@gmail.com on 14 Jun 2010 at 5:35

GoogleCodeExporter commented 8 years ago
Amit, if you are not working on it , I would like to work on it.

Original comment by junaid...@gmail.com on 4 Jul 2010 at 9:48

GoogleCodeExporter commented 8 years ago
I am working on it ..why don't if you would like ..we can both work on it ....

Original comment by amit.ha...@gmail.com on 4 Jul 2010 at 11:28

GoogleCodeExporter commented 8 years ago
Let's keep one task to one developer. Amit, can you please upload your design 
document soon? If you don't have even the design, after almost 20 days, let's 
give this task to junaidmcs.

Original comment by atra...@gmail.com on 4 Jul 2010 at 4:30

GoogleCodeExporter commented 8 years ago
I have reassigned this to junaidmcs (Muhammad)

Original comment by atra...@gmail.com on 4 Jul 2010 at 7:02

GoogleCodeExporter commented 8 years ago
Muhamad, please upload here what is your approach (i.e. design).

The requirements are:
- Separate Yahoo DataService code from UI code.
- Make actually separate Jar files which can be installed separately (i.e. data 
only)
- The DataService should update a percentage download complete shown in the 
System Tray

Original comment by atra...@gmail.com on 4 Jul 2010 at 7:05

GoogleCodeExporter commented 8 years ago
Curently, I am facing problem to checkout the latest code. There is RA layer 
problem. I will try with completely new check out , after this I need to 
require 4 hrs to decide my approach , that how I can seperate the Data layer 
from UI layer.

Original comment by junaid...@gmail.com on 7 Jul 2010 at 3:28

GoogleCodeExporter commented 8 years ago
Please see
        http://finance.groups.yahoo.com/group/quantdesk/message/126
        "Re: issues when checking out the code from SVN (resolved)" 
and the previous messages in the thread 
on the "RA layer" problem during the check-out.

Original comment by Andrey.D...@gmail.com on 7 Jul 2010 at 4:40

GoogleCodeExporter commented 8 years ago
Please expand my hrs limit from 0 to 4.

Original comment by junaid...@gmail.com on 8 Jul 2010 at 8:01

GoogleCodeExporter commented 8 years ago
My first priority is to Separate Yahoo DataService code from UI code 

Current Application flow:
- When AnalyzerUI class is loaded StockModel instance is created
- This stockmodel create a UpdateStocksThread
- This thread is resposible to fetch stock data by using MyYahooStockServer
- After this AnalyzerUI constructor is called with stockmodel instance. In 
setupComponents() there is another thread StockThread to get all stock data by 
using model instance
Note: Issue 21 shows that all SWT components are being replaced by swing 
components, that will be help full to us because mostly swing components follow 
the MVC.

My New Approach:
- All code from AnalyzerUI will be removed that can call model/yahooserver 
directly.
- All jar files will be removed which are using to fetch stock data by using 
UpdateStocksThread
- All classes related to fetch stock data will be moved into a new package in 
QuanDesk_DataServices
- AnalyzerUI class can only access to a controller class. 
- A controller class can only call to model class after some validation check.
- A model class can fetch the data directly from yahoo stock server. 
- The way to fetch data from yahoo server will be like this:
AnalyzerUI.aStockList = controller.getAllStock();
and the implementation of  controller.getAllStock() could be like this
List<Stock> getAllStock(){
    if(isValid)
    return createModel().getUpdatedStock();
}

- Estimate hrs to complete this task is 15-20 , but first we should wait for 
completing issu 21

Original comment by junaid...@gmail.com on 10 Jul 2010 at 2:37

GoogleCodeExporter commented 8 years ago
junaidmcs, thank you for your analysis. Please provide some more details which 
are not above:
1. UpdateStocksThread, MyYahooStockServer, and StockModel which will become the 
new DataService should run by themselves as a separate application, with option 
to Minimize To System Tray. 
2. The DataService should include it's own Derby jars and use Derby (in Derby 
Network Server mode) to store all its data.
3. A new version of StockModel, probably call it StockModelDAO, should provide 
a Data Access Object layer using JDBC and Hibernate.
4. The UI should use StockModelDAO to access the data from DataService via JDBC.

Please confirm if all these details are included in your 15-20 hour estimate, 
or provide updated estimate.

Original comment by atra...@gmail.com on 10 Jul 2010 at 3:47

GoogleCodeExporter commented 8 years ago
Currently, stocks data is saved into csv file and then retrieved from this. In 
my estimated hrs I didnt consider the Derby database or option to minimize to 
system tray , I focused only to seperate data layer from UI as in first phase. 
I checked and found that there are 27 attributes for a stock record which are 
saving into csv file. I suggest, first we follow the same technique to 
save/retreive stock data and then I will replace it by Derby database. But if 
you like to save data in derby database instead of csv file then let me know I 
will analyse to estimate the time frame for it.

Original comment by junaid...@gmail.com on 14 Jul 2010 at 12:41

GoogleCodeExporter commented 8 years ago
My opinion is that this is solely about separation of responsibilities between 
the data layer and UI, not about transitioning from CSV file to embedded Derby 
DB. I'd say it's more a prerequisite for such transition: when the data 
services are separated from the UI, it is much easier to switch the data 
storage technology.

IMO, currently the application is lacking features more than embedded DB or any 
other technological "decorations".

P.S. Please keep oDesk weekly hour limit discussions outside the IssueTracker 
and Yahoo Group: discuss it in private correspondence (via e-mail or oDesk 
messages) with Alex.

Original comment by Andrey.D...@gmail.com on 16 Jul 2010 at 3:04

GoogleCodeExporter commented 8 years ago
when issue 21 is done please let me know . I will start my work after it.

Original comment by junaid...@gmail.com on 22 Jul 2010 at 1:11

GoogleCodeExporter commented 8 years ago
Owner: junaidmcs -> Andrey.Desyatnikov
Priority: Medium -> Critical, since this issue blocks Issue 28 "stock scanning 
feature is unacceptably slow" which is Critical.

Original comment by Andrey.D...@gmail.com on 21 Sep 2010 at 11:17