Question

There is a core ERP mobile application for Android. A customer has requested additional features that will require more screens (and Activities) and extra functionality.

Is there a way I can add sort of an extension to the core mobile application in order to intergrate the extra features or should I code on top of the code of the core application?

I am interested in finding a neat solution focused on extendability since different clients might ask for different additional features. How would you deal with such an issue? Any tips on the structure of such a project would also be welcome.

Would it make a difference if the extra features need to use the same db as the core application?

Thank you in advance for your help.

Was it helpful?

Solution

The answer to your question lies in the Open/Closed principle introduced by Bertrand Meyer. Open/Closed Principle is a very simple Object Oriented Design principle which states that

Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification"

From your question its clear that you have identified the core functionalities in your application. So rather than Modifying this core functionalities and making it more specific, I would recommend, on the basis of the Open/Closed principle, that you should freeze your code features and write your customer specific functionalities over it without corrupting the core.

Now to answer your question on what kind of structure you may follow. I would recommend that you create a library project of your core functionalities and make different client specific projects that would include your core functionalities as a library project.

It won't make a difference if your application is using the same db as your core application provided all your applications uses it, else it should not be in your core application in the first place.

Hope this explanation help you.

Update:

My friend pointed out that I may not have understood the question right. So rather than correcting my old post(...which may be useful for others) I am updating it.

So if I understand it right, you have an ERP project which you may not have coded. The right approach, according to me,still would be that you build over this existing code. Rather than making changes on this project, include it as a library because if the project is downloaded from a reliable source, you will have the benefit of getting the updated version as and when it is available.

OTHER TIPS

This is kind of a design philosophy question. Here are a couple choices that might give you ideas:

  1. You could look into making your core application code/features into a custom library. Then your new core application is just a simple wrapper that includes the custom library. Your additional features for a specific customer could then be a different app that also references the core library but will include additional features. There are lots of tutorials on how to turn your app into a custom library. You would end up with different apps that target different a customers. (A tip that took a while for me to uncover is that if you have a resource name in your custom library you can "override" it by using the same name in the app that includes the library. Another tip is that you need to essentially duplicate the manifest of the library in the app by listing all the activities in the library that would be used by the app.) I haven't tried this but it might be that your additional features are each libraries that are included in different apps.

  2. You could have an key the user inputs that will unlock certain features. You could save this as a shared preference so that they don't need to keep entering the key. This approach has the benefit that you can "reuse" features for other clients without any more implementation other than determining which client gets what feature. The majority of users just wouldn't have a key to unlock anything.

Both these solutions should use the same db since they would be calling the same core classes, etc.

Another possible solution is to create a Library Project. Put your core ERP app code inside the library Project, and then create different project for different customers. Each one of these projects will also use the same library project.

Your core library project could expose an api to dynamically register new features (Such as a menu that can expose new menu items).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top