last day (38 days later) » 

2:14 AM
Hello
 
 
19 hours later…
9:04 PM
Hi. If you need to ask me something more, let a message here. I'll try to answer as soon as I can and if I know the answer.
 
 
3 hours later…
11:43 PM
Hi Dakis, let'me first introduce myself. For some years I've developed with Java, in projects that use SpringFramework. This framework lets you configure (so creates) all classes and their dependencies in XML files. So you dont have to worry about where to instantiate in your code the classes.
For example, these XML files creates the DBConnection, DAO objects (similar to Mappers) passing them the DBConnection instance created before in one of those XML files, Services objects passing them the DAO objects created before in others XML files, and so on.. until getting the Controllers instantiated in the servlet-config.xml
So you dont have to do this: dbConn = new DBConn(); conn = dbConn.getConnection(); oneDao = new OneDao(conn); twooDao = new TwooDao(conn); service1 = new Service1(oneDao); service2 = new Service2(twooDao); ......; oneController = new OneController(service1); twooController = new TwooController(service2);
All of these are configured in XML files, so you just dont do any instantiation in your code referred to these MVC classes. I know it´s because of the SprinceFramework Library that's is a big package of my libraries.
But conceptually, I have never have clear of the MVC pattern, because in all jobs I get to work there was already the projects constructed with SpringFramework.. and just did some kind of routine job, following the same code of other people..
But now starting with PHP, I want to learn what is all behind. I've read many articles and many say there is confussion and mistakes conceptually about MVC.. for example in using Singleton just as one example. Other about the relation of the Controller and View (saying that the View should only retrieve the data from the Model and not the Controller)....etc..etc
I was looking at github some projects that can give me an idea, where to instantiate the dbconnection, models, services, controllers, in order to create just one single dbConnection in one request, and just one model, controller and so on. But I cant find a good sample or project in github at leaste a very simple one, using the best patterns, for example, no creating many dbconnections, or many models each time I want to insert a row in a table (just one model for the whole request), etc etc
 

  last day (38 days later) »