Argentina
Joined: Sep 8, 2009
Post Count: 40
Status:
Offline
SH3D design. Do it less coupled
Hi Emmanuel, I've bee using SH3D for a while and became kinda familiar with its code.
I have a sugestion for next releases: Split the functionality and decouple each others. What I mean, many non-core functions could be implemented as plugins, and delivered with the installer (which can even be optional) For instance, the ModelManager loadModel, might use Service lookups to locate the available loaders (those that implement Loader)in the system. I bring this because I'm working in a NetBeans RCP version of SH3D, And have done some changes toward this. You can check this at https://sourceforge.net/projects/sh3d-nb/ Still some refinement is needed (e.g. at loading an NPE must be fixed. I did it here, but still need to submit the changes) Please, if you have the time, check it out and tell me your opinion. As I said, it's a NetBeans RCP app, but it shold not be quite difficult to compile it outside, provided the needed libraries.
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: SH3D design. Do it less coupled
Alied, I don't really understand your point: - Additional Java 3D loaders can be specified by the System property com.eteks.sweethome3d.j3d.additionalLoaderClasses used in ModelManager class. A Service lookup is probably better but I felt that setting a System property + changing classpath would be simpler! - Anyone can develop and install plug-ins with additional features accessible from the user interface. The plug-in system isn't probably perfect because there's no user interface in the program to manage installed plug-ins and it doesn't give access to program's controllers and views. But as so few developers showed some public interest to it until now, I prefer to add features required by users. - Furniture catalog, textures catalog and user interface languages list can be customized and extended with SH3F, SH3T and SH3L files. - If you need a light version, program can be launched without iText, FreeHep, SunFlow and JMF libraries (like in the Online version shown to unregistered users); simply disable the actions that give access to the features requiring these libraries, in a derived version of the program. - I try to keep program not too complicated with a clean MVC architecture, ensure backwards compatibility, and use Java packages as modules with clear dependencies checked by PackageDependenciesTest. Within a package, some classes are even completely or mostly independent from other classes like the DAE/Collada Loader I developed recently.
Until now, all this seems to work better and better, since the last derived version I programmed didn't require me to change Sweet Home 3D API, even if that program required new types in its model and a different user interface. But I guess you know all that, since you're familiar with the code. So what additional changes should I make without breaking compatibility?
About your NetBeans RCP version, I succeeded to check it out, and load it in NetBeans 6.8, but it refuses to run from NetBeans. It says:
Any idea? I'm not used to NetBeans and ran it only for its nice profiler until now.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator