Base solution for your next web application
Open Closed

Can you explain the module system? #184


User avatar
0
vitor lacerda created

Hi Halil,

Can you explain the module system?

A module can contain 5 projects: Application, Core, EntityFramework, WebAPI and Web?

Imagine an application that contains a main module with entities, domain events, domain services, application services, web api, web, etc.

Now imagine that a new module is created, it will depend on the main module and will add entities, domain events, domain services, application services, web api, web, etc.

These modules will communicate using "DomainEvents"?

Should I use the embedded resource to store the frontend module views as html pages, chtml, css, js ?

You can share a simple implementation using the module system where each module can contain each of the projects like a main module?

Sorry my english.

Thank you for the great work.


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Modular application development is a hard topic. Especially for front-end. ASP.NET Boilerplate provides a good base for server-side modularity. I can not explain in a simple forum post, I'm planning to create an article for it.

    But, briefly;

    A module (say that a blog module) can be built as 5 sub-modules like core, application, webApi... and so on.. So, we can choice to only use domain module (layer) or all.

    In ABP, generally a module is an assembly (but not required) that has a class derived from AbpModule class.

    You don't have to use DomainEvents. If module A depends on module B then it can directly use B's entities, services.. B will be independed and re-usable. But, surely for some cases it may needed to trigger some events in B to communicate to upper layers. You can use event bus or define an interface in B (with a Null implementation) and implement in A. There are many patterns here.

    For html,css,js files, embedded resources can be used but you may need to go some deep infrastructure of ASP.NET. ABP has not a good support for font-end modularity now. Also, you can search for techniques to make modular UIs using angularjs (if you're using it). It's not in ABP's scope, at least currently.

  • User Avatar
    0
    hikalkan created
    Support Team

    Hi all,

    I started to create a blog module to be a sample for community. It's not fully functional yet, but you can check and test it: <a class="postlink" href="https://github.com/aspnetboilerplate/sample-blog-module">https://github.com/aspnetboilerplate/sample-blog-module</a>

  • User Avatar
    0
    vitor lacerda created

    Thanks Halil.

    I will check this sample!