I am building a CMS and need guidance on how to structure the application. I simply do not understand when I should use interfaces or an abstract class.
The system being built is using .Net Core and EF core I plan to allow MySQL and SQL Server as datasource. I also want a modular approach where I can add things on a paid for basis for example e-commerce and payment module.
The design of the current layers is listed below
Database - Contains 3rd party dependency to EF Core
It contains all the BusinessEntities with multiple classes but two Interfaces one is IGenericProperties (Which has properties shared between classes e.g. IsDeleted) and IPrimaryKey, most entities implement these interfaces.
Also contains DataAccessLayer and one interface IGenericMethods this has multiple methods such as Add, Deleted, Retrieve etc which the GenericObject class implements. All other DAL classes then inherit GenericObject
Lastly the EF DatabaseContext is also specified in this layer.
Framework
This has framework content such as extension methods, searching and non-db related stuff.
Security
This has the ASP.NET Identity stuff such as UsersStore, Roles etc.
Lastly I have MVC and Tests layers.
The controllers in the MVC layers can then perform CRUD operations like this
CategoriesDAL categoryObject = new CategoriesDAL();
IList<Category> getAll = categoryObject.RetrieveAll().ToList();
However, upon reading more about Dependency Injection and layering (reading Adaptive Code: Agile coding with design patterns and SOLID principles (Developer Best Practices, Gary McLean)), I am questioning whether the approach I am going down is usable or whether I'd have issues in the future. A few things I can spot is how could I possibly make this modular such as adding e-commerce modules as I'd need to reference EF.
I have looked at source code examples on github of other CMS/Frameworks Umbraco,MrCMS, Orachard,Piranah. These systems do have a lot of layering and interfaces, and I am simply struggling to understand it.
So to sum up my question.
When and why should I use interfaces / abstract class?
How can I make my current application more modular ? (such as having e-commerce modules)
Thanks