Implementation Approach
5.1 Difficulties Encountered
5.1.1 Project setup (hard)
In my proof of concept, I created the main application in JavaFX which was acting as a launcher for other applications/plugins. This solution was working perfectly, but later on, when JavaFX was combined with Spring there were found 3 problems. - When the button was clicked to open another plugin, then for some reason the new instance of Spring was waiting until the previous instance was terminated.
- The startup of Spring takes about 10 seconds where a user isn’t notified, thus extra solution e.g. adding Threads would be used to notify the user, which would bring an extra difficulty to implement.
- The testing and debugging would be very difficult because each plugging is a separate project and for each has to be separate tests written.
It was too risky looking for a different approach to achieve those goals while it consumed a lot of time already. The solution would be closing one instance and opening another
25
Project Implementation 26
one with a 10 seconds gap between each action. Where one window is closed and in 10second another window is opened, but it isn’t aesthetically good.
For those reasons I created a single project and developing each plugin in a separate package to possibly return to the original approach if a solution were found. The project is running a single instance of Spring so the user must wait for a ten-second just once.
By changing approach this way it brings easier testing, debugging and absence switching between projects. Just one JUnit test was created to test all plugins at once.
5.1.2 Combining Spring with JavaFX (hard)
At the beginning were two projects created. The Spring with JPA and Hibernate con-nection to the SQLite database initiated in the Spring Tools Suite and JavaFX views with controllers started in NetBeans because we cant create JavaFX projects in STS and vice versa. Each concept was tested and working, however, I was dealing with big difficulty to put them together.
I did try every combination of all methods, and it was just one working. Firstly, a new Spring project with JPA Hibernate and SQLite was created in the STS. Then this project was imported to the NetBeans where were added new controllers FXML views and initialization in the main method. Finally, the Spring must be executed before JavaFX, otherwise, the application wont start.
After those trials and errors, the goal was achieved without workarounds but took five times more time than accepted.
5.1.3 Java Persistence (easy)
Doing Java Persistence was new to me. There are not many tutorials on the internet, thus it took a while to learn it. One problem which needs attention is an automatic dropping all tables on application startup. It was an advantage at the beginning as Spring was dropping tables for me which saves my time during the testing. However, a user needs to store data permanently. It took some research to find that it must be set in the configuration file. [5]
When the configuration file was set correctly the data were saved in the database per-manently.
Project Implementation 27 5.1.4 System Tray (medium)
The System Tray is developed in JavaAWT contributing Swing Thread for Pop-up mes-sages. It was tested with JavaFX and working without issues, but the problem was found when Spring with JavaFX was added together. The exception was thrown that Tray is not supported even if it previously works.
Figure 5.1: No System Tray support
The JavaFX, AWT and Spring must start in that order, otherwise, the exception is thrown. But the application wont start if the Spring is not running. From previous experience when I was adding JavaFX into the Spring project to solve this issue it took just a little while to make it work. Finally, the problem was solved when the Spring was placed into the thread.
Figure 5.2: Terminating Spring
When each platform is executed in the right order it also solves the problem with the 10-second problem. Because JavaFX doesn’t have to wait for Spring to boot up, the view is presented to the user nearly immediately and allows it to implement an indicator that the application is loading. I also have to make sure that a user will not crush the application by making a request or exit an app before Spring isn’t fully up and running.
After all, the result is even better than accepted.
Project Implementation 28 5.1.5 Threads (easy)
From previous experience with threads in JavaFX, it was found that there is a problem with concurrency so Schedule or Task must be used, thus I was accepting some issues during implementation.[6]
The project is using one Thread for JavaFX, different for starting Spring, another for running Spring, then AWT Tray and each plugin use extra thread for checking and updating To-Do list.
Managing all those threads is difficult to make sure that same thread is not starting multiple times and most important is terminating all on exit.
5.1.6 JavaFX View (medium)
Most of the applications running under the Windows OS have a fixed size of frames or not using full width when maximized. From the first time, I was trying to create a responsive application. This technology was new to me, thus I was learning all the way.
The application is now responsive and works as planned.
5.1.6.1 Illness (hard)
The most difficult thing for a developer is being ill. I was dealing with that problem for about 10 days, where I was unable to focus on the project and college work. Fortunately, all major difficulties with development were solved earlier thus there were no roadblocks or risks ahead. For that reason, I didn’t complete two sprints where a lot of work wasn’t done. Also in the meantime, the other work, assignments, were piling up. It was extremely hard to distribute effort to all renounces and get back into the track.
However, the stakeholder is happy with the progress, willing to wait for the first release and looking forward to future cooperation.
5.1.7 Breakdown (medium)
The project is developed to be independent on the internet for insufficient internet service and mobile service quality. On 24th April my internet service was interrupted when the computer was making the backup of the project. The sync with the cloud failed thus progress I made past 12 hours disappeared and I couldn’t be recovered. My progress from that day was gone. Also, there was no way to contact ISP technical
Project Implementation 29
support until Monday morning and servicemen werent available until 1st of May. On top of that, all my documentations were paradoxically stored in the cloud and I couldnt reach it with other services like Canvas or Gmail. To keep me going I set my old mobile phone as an Access Point with a mobile phone placed outside the window to have better reception and repeated Wi-Fi into the laptop. The internet connection was very limited and dropping quite often because mobile reception in this area is very poor. However, it let me make some progress. The problem with an internet connection was diagnosed and fixed remotely with a technician on Monday morning, but I loose another 3 days for this issue.