posted 7 years ago
I have an application which i am currently working on which is like a ftp downloader. It gets information from an .xml file where an ftp server, user credentials etc. are defined and of course the filename. When a user clicks to load such a file, i send an event out "FileAdded".
I have a "mainview" which is a frame. This frame exists of 3 panels, so i made 3 mvp packages. One contains just 2 buttons "Start all downloads" and "stop all downloads". Another one contains a JTable (a specialized one with a AbstractTableModel modified for my needs) which represents the download state of each of those files, added as .xml.
Another one just shows general status informations (file added, current overall download speed etc.).
[DELETED]
The problem is now the downloadMvp. [DELETED]
Thats the part which looks so horribly wrong to me. I am pretty sure this is not the "best" way to achieve that. The problem is the downloadModel uses a "construct" i wrote to handle the download (more or less a simple ftp client) for each file. Inside this i send the downloadChangedEvent, and i guess thats already wrong.
Maybe someone can bring some light in this. I would love to have something like this in my presenters constructor:
Is it wrong to use the downloadModel to include business logic like i did? If not, i guess i have to completly rewrite the ftp engine which works behind the scenes...