aspnetboilerplate: How to implement dynamic module management? - aspnetboilerplate

How to implement dynamic module(plugin) installation/deletion in aspnetboilerplate?
suppose I create a separate class library project to implement versioning of project module
e.g. for a billing module(plugin) I create a separate class library project & a separate dbcontext within that and create multiple versions of that dll
for fine grained updates to the aspnetboilerplate application I want ability to deploy the dll dynamically,
I mean when I build new version of billing module(say v2) I want to deploy that dll only instead of deploying the whole aspnetboilerplate project.
how do I achieve this?
My requirement is to implement plugin kind of architecture in aspnetboilerplate.
plugin can be dynamically added or removed or upgraded to newer version through UI
-nitin

Related

Best practice- share Spring-boot Service and Repo layer code between applications

Need some best practice recommendations to a classic requirement around modularising Springboot application based on layers.
Some background info:
Small- medium size Spring boot project with less than 10 developers
2 different Spring-boot applications and shared Service, Repo layer and also shared models
Bit too late to go with micro service approach with full Model/ Controller/ Service/ Repo per API.
Currently there is just one web application exposing the APIs for a frontend application.
Requirement is to add new set of APIs which are used for B2B integration, so the request/ response formats will be quite different to the already available APIs. i.e. /webapi/v1/orders for frontend client and /b2b/v1/orders will need to return different response format.
The Service and Repository layer along with the models need to be shared among the 2 applications, so 3 modules identified as similar to how it's explained in https://stackoverflow.com/a/50352532/907032
-- Main app
-- Webapi (Got dependency to common, jar packaging)
-- b2b (Got dependency to common, jar packaging)
-- common (jar packaging)
The two applications need to be deployed separately and also separated from CICD perspective not to build all the sub modules every time (A change to b2b controller should not affect common/ Webapi)
A change to common module which is only required to the latest b2b module, preferably should not trigger a build and deploy of webapi. i.e. webapi uses common-1.01 and b2b module uses common-1.02. Understood the new version common-1.02 should not break any feature from common-1.01 but just trying to save unnecessary build & deploy for that module until required if that makes sense.
The challenge
Should the modules defined in the same Repo or 3 different Repos?
All the talks about mono vs multi repo is about whether to keep all different projects in same or not, but here as you can see these are modules which are kind of related to each other.
If we define these as sub-modules in same Repo, how versioning of the common module handled? If it's always triggering a build of all three sub modules, do we even have any advantage of modularising the code?
As per your description, the module named "common" is not not that comon to the other two. I'd go with the multi-modudle way by doing so:
first break that common module in three: common, utils-webapi, utils-b2b
The first will strictly contains the thing both webapi and b2b need at the same version. Utils-webapi will be dedicated strictly to the things in api. Same goes for utils-b2b
B2b depends on utils-b2b with depends on common. Webapi depends on utils-webapi with depends on common
Versionning of common module is always consistant, only utils-X module version change from the X module perspective
CI is thus independant for each build.
Note: You can go further and simply consider utils-webapi utils-b2b and get rid of common. At the cost of some deduped code.

What is the best way to create a new blank UI while keeping the ABP Framework infrastructure?

In a Multitenancy B2C application, the interface created by the Application Startup Template applies well to the backoffice, but for the storefront website I think it would be necessary to create a blank UI project (angular or MVC).
What would be the best practice for keep the ABP infrastructure that provides functionality such as customization by Tenant, Tag Hellpers, Proxies, Localization, etc. without bringing unnecessary dependencies such as JS libraries and other components like menus, datatables, sidebars?
What you are looking for is a Public application template. Abp framework is created modularity in mind so that you can use modules in each other if they are developed in modular way.
I don't think it is feasable to say "add these projects and libraries".
However, you can check the microservice demo, PublicWebSite application at abp-samples to see which libraries are added so that you can modify an empty project as you desire.
Overriding a View Component The ABP Framework, pre-built themes and modules define some re-usable view components. These view components can be replaced just like a page described above.
https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface#overriding-a-view-component
Replacing ALL UI Theme Package with your custom Project by copy the Basic Theme (from Github).
MVC https://community.abp.io/articles/creating-a-new-ui-theme-by-copying-the-basic-theme-for-mvc-ui-yt9b18io
Blazor https://community.abp.io/articles/creating-a-new-ui-theme-by-copying-the-basic-theme-for-blazor-ui-qaf5ho1b
Or check these others links https://community.abp.io/articles/changing-ui-theme-for-abp-mvc-razor-pages-ui-ravx6a0o.

how to access some new java classes added to the existing jar from gwt project when we run with Maven

I am facing below issue when I am running maven for gwt project.
in my project we have "A" project created by using gwt frame work.
"B" project is a java project and we need to access B project classes in "A" project server side.so created a jar for B project and added in A project build path.
Now I need to add some new classes in B project and that new classes should access from "A" project client side.
We can able to add new classes in B project and after running maven for B-project, we are able to see new classes in B-project jar.
But when I run maven for Project A it shows an error like "did you forget to inherit a required module?".
Note: same test projects I have created and can able to access B-project new classes in A-project client side code. But when I am running with Maven it is unable inheriting these new classes.
Kindly advise me how to solve this issue.
Generally you need to compile your code into javascript in order to make it accessible from the client side (if we aren't considering requestfactory proxies, web services etc. here). If your code is located outside the GWT module it simply doesn't exist for client side. Practically this means that you need to extract the client side accessible classes from the B module and put it into A\shared folder for example. Also don't forget to place <source path="shared" /> into your A gwt.xml descriptor. The drawback of this refactoring of course is that you're allowed to use only "JRE emulated" classes in your shared code.
Another solution would be a creation of a gwt module inside your B project and inheriting it in A project.

Site separation per customer using spring mvc and maven3

Just a general question on any techniques used to seperate your web application for customer specific requirements. At the moment I have one web application but I need to add new functionality for one customer thats not needed by another. I know spring 3 comes with new support for profiles but I'm just curious if anyone has had a similar problem and how they went about solving it particularly using spring mvc and maven as a build management tool
The proper way to do this would be as follows:
Have a web assembly module. This module will build a war file containing the proper features extracted into separate modules simply defined as dependencies. My advice is to have a separate web assembly project per client. This way you will keep things neat for yourself, avoid mix-ups (such as releasing features to clients who haven't paid for them) and have an overall easier maintenance.
Furthermore decide whether to do your version separation at the level of the version tag or classifier:
The version tag you can use in order to separate things in branches.
The classifier tag you can also use to separate configurations specific to your clients.

Package structure for Spring MVC project with multiple sub projects using Maven

We want to create a spring MVC project using maven. We want to use just one project and, under it, have multiple sub-projects
What would be a good directory/package structure for the project for example
com
company
subproject_1
controller
doa
service
entity
subproject_2
controller
dao
service
entity
or all files of sub projects in one project
com
company
controller
all controllers of all sub projects
doa
all dao of all sub projects
service
entity
depending on the experience which project structure would be maintainable if the project increases and sub projects keeps adding on
or suggestion of any other package structure?
also what is the naming standard used for directory
is it entity or domain? doa or persistence?
Why not following a multi-module project structure to group your sub-projects? It's a good coding practise widely adopted, recognised and easily manageable. Have a look at this example.
As far as the naming conventions goes that's personal preference but it's good idea to clearly maintain in package structure the different layers as you are saying from botton-top approach: the dao level, the domain, the service layer, the controllers and finally the view.
Try to use the add to working set option.
Create maven multimodule project.
In each project two options:
package by feature
package by layer
these options discussed here: http://www.javapractices.com/topic/TopicAction.do?Id=205
My personal approach is to create in each maven module project packages by feature and some "util" packages used by "feature" packages.

Resources