PekinSOFT-Systems / Northwind-Basic

Repository for the Northwind Traders Complete Accounting Basic Edition
GNU General Public License v3.0
0 stars 1 forks source link

Modularity in Java vs. NetBeans #8

Open SeanCarrick opened 4 years ago

SeanCarrick commented 4 years ago

I am starting to doubt attempting to do even the Basic Edition in plain old Java. I want to start creating some of the dialogs for input of data, in order to get a visual of the data and how it relates via the interface, but I still want to keep the system modular.

My biggest problem is trying to figure out how to only show menu items for windows/dialogs that have a module related to them available to the application. Also, I am confused as to how to keep the windows/dialogs that belong to a module, such as Load Tracking, within that module, yet be able to display them via the MainFrame class in the com.pekinsoft.northwind.desktop package and com_pekinsoft_northwind_desktop module.

Can you point me in the right direction on this? Or, should we build the Basic Edition as a NetBeans Platform application? I really think I messed up beginning the coding in the way that I did.

jkovalsky commented 4 years ago

Looking into this. Please stand by.

SeanCarrick commented 4 years ago

Standing by...

jkovalsky commented 4 years ago

Please consider my https://github.com/PekinSOFT-Systems/Northwind-Basic/pull/13 I hope I didn't forget to include some file or change. :)

SeanCarrick commented 4 years ago

Since I commented this on the closed Pull Request #13, I am re-commenting it here for good measure...

So, in the Startup.main() function, the classes you created read all modules stored in the ${HOME}/.netbeans/modules/ folder and load them into an ArrayList. We then simply need to provide for all GUI components within the module that needs them and we can load the information into the MainFrame form at run-time. This is rather awesome! The only change that may be needed is to allow for the modules to be installed wherever the application is installed, such as C:\Program Files\Northwind on Windows, or /usr/local/northwind on Linux. This would be able to be set in the ${HOME}/.northwind.conf file with the setting module.dir=PATH, for example.

Somehow the special comments that denote the start and end of generated code blocks were removed from the MainFrame and weren't present in the AboutDialog, which is causing them to open read-only. I will recreate the MainFrame form and will create the main menu bar only, with no menu items, except for the ExitMenuItem for terminating the application.

On that subject, is there a way we can designate where a menu item appears within a menu? For example, since the ExitMenuItem will already exist in the FileMenu, is there a way we could set the NewMenu to be above the ExitMenuItem, and possibly a separator in between.

Also, with the XML file, it stores the name of the module, module version, and the master class (similar to NetBeans Installer class, I assume). Do you think there is a way of using the XML file, or another XML file, perhaps, to set up the menu ordering?

I am thinking this will take quite a lot of logic to do, such as:

  1. Finding all menu item classes.
  2. Determining to which menu they are to be installed.
  3. Looking at the value for the order of installation.
  4. Finally, placing the menu items into the existing menus, in the required/requested order.

I am not even sure that this is worth the energy to perform this exercise.

Another alternative, if we can figure out all of the menu items that will be needed, we could set them visible or not, depending on whether the module that uses them is installed.

Do you have any ideas with this? Or, am I even making any sense at all?

SeanCarrick commented 4 years ago

Just a thought after a good night's sleep: I think that because of how I started this project that we are going to end up completely reinventing the wheel. Even though I know that we will be able to solve all of these issues, do you really want to go through the process?

I mean, we have not done all that much yet, so I believe that we could just dump this and switch over to NetBeans Platform without too much pain. After all, that was the original idea, to use the NetBeans Platform to create the system.

However, if you want to continue to do it this way, I am open to it. I just want to be sure that we want to do all of this work (which has already been done for, what, 20 years by NetBeans?) before we dig in to deep to change. Please, let me know your thoughts on this before we go too much further. Thanks for everything you do to help!

jkovalsky commented 4 years ago

Good morning! That's exactly what I wanted to conclude on. We would be able to create our own modular system after several months which would be as good as the very first version of NetBeans RCP but it's in my opinion not worth it.

I have helped partially because you asked me and partially because I was curious and wanted to try how hard it is to create the modular proof of concept myself. :) Taking the right decision now is very cheap if compared to doing it 6 months later. Having said so I think switching to NetBeans RCP is a sensible approach.

SeanCarrick commented 4 years ago

See this, you and I are on the same page! I think this is why we are going to be able to create the greatest accounting package for truckers that has ever been created. ;-)

So, let's do the smart thing at this point and switch this to the NetBeans RCP, as originally decided. I'm not that good with the NetBeans Platform yet, so it will be a few days before I make the change up here. If you would like, you could create the new Northwind Platform repository in a way that you believe would be best. For example, my thoughts are that we would create the repository for the Northwind application itself, with separate repositories for the modules for the Basic, Corporate, and Enterprise Editions. However, I would like you to set up the repository or repositories in a way that you believe makes sense. If you were to go with my thought, we could maybe even have a repository named Extra (or something similar), where we could place other modules that we may come up with plans for in the future that would only extend the functionality of the Northwind application, but not necessarily be one that was discussed in the Project Specification document.

Thoughts or ideas?

Thank you for your willingness to help on this project.

jkovalsky commented 4 years ago

Thanks! :) I don't see any added value in having multiple repositories. Instead I think it would be better to have everything in one place so that it can be just cloned as a whole and compile with all dependencies met without any need to configure it in advance. But I defer the final decision to you Sean! Have a great day!

SeanCarrick commented 4 years ago

OK, then, a single repository it is. I am working on a refresher for working with the NetBeans Platform right now, so I'll get the repository created a little later today, or tomorrow at the latest. Thank you! You have a great day, too!!