I am creating an MVC application framework using only LibreOthers and Components, which I myself I am making a learning experience from), but I am not completely sure how to separate each type of library from each other.
We will call our application cats.
We say that I am creating a library called a dog, which will be like a zind and will be filled with various components that work differently (database classes, DAL, router, which is given from a given URL To locate the controllers to choose), and will be located in the Route / Library / DIR.
I will also create an App Library which will be application-specific (can be in a class like FrontController or application to help start and configure the app) This root / app / library / < / P>
, I want to use the dog's library on both this application and other applications, and hope for that we want to be independent of the cat, so used it Education can have a number of other applications.
In my cat application, I have to say create a new database object should write to me:
$ database = newDog_Database ();
Or would it be better to have a Cat_Database class that enhances the dog's database? This would mean that I can later tell Cat_Database to increase the Fabrite database if necessary ...
I think the main question is whether my application talks directly with the Shared Library Should it be called, or should it call the app-specific library classes which, in turn, extend from the required shared library?
I think that you answered your own question to a certain extent that you say to the dog If you want to be independent of the cat, it means, for me, using too much dependency injection between multiple heritage or direct calling. You can not extend your app library to classrooms from the framework if you want to use the App Library again without the framework.
It is difficult to give detailed advice to a detailed question, perhaps some of these concepts will help you.
Comments
Post a Comment