I need to reorganize the Java EE application because the current design is not very modular, it is actually quite a mess. There is a business facade, but since the application was developed by several people, and therefore the initial design was ignored several times. The app currently runs on tomcat with JSF, but will be ported to websphere soon. I have already done some research on various design patterns to encapsulate business logic from a view, as well as how to make a modular application so that it is easy to add more functionality because the application will be improved in the future. I read about OSGI, but I think that would be redundant.
The application is already layered. But I am far from defining an API. I already cleaned up the application a bit. Now all beans access business logic through business facade methods. But the business facade consists of about 40 methods, which, I think, are not very pleasant.
Third Party Editing
For example, I have these model classes
ManageLdap using methods like createAccount and deleteAccountGroupManager that manages ldap groups
In the business facade, I have a createAccount method that
- calls the
ManagerLdap class to create an ldap account and - performs some recordings as well
- calls
GroupManager
This pseudo code
package Model.ManageLdap public class ManageLdap { public ldapAccount createAccount() { } public ldapAccount deleteAccount() { } } public class GroupManager { public bool addAccountToGroup(var account) { } }
And in the business facade
package BusinessFacade.Foo public class SomeFoo { public ldapAccount createAccount() { var ldapAccount = new ManageLdap.createAccount(); Logger.log("Account created"); var accountWasAdded = GroupManager.addAccountToGroup(ldapAccount); } }
Now, if I want to add additional features to the application, for example, create a subversion repository for the user
- I need to implement a model class to create repositories,
- enter some methods in the business facade and
- Create an additional bean to access the view.
This makes the facade even larger and more confusing, but beyond that, this is not what I call modular design.
So, how can I separate business logic from presentation without a huge business facade?