Tag Info

Hot answers tagged

12

In my experience, a web application would have to be trivially small to not benefit from the organization and decoupling that MVC provides. Perhaps a bit of explanation about the MV* family of architectural patterns is in order. The MV* patterns concern themselves primarily with the User Interface. Their primary purpose is to provide decoupling between ...


3

This rule and consequent warning is sensible - I definitely wouldn't like to see class/constant definitions mixed with side-effects in one file. But in this particular case I wouldn't mind - PHP bootstrap files are usually a bit like this - setting up the environment which sometimes consists of several distinct (and possibly unrelated) steps. You could ...


2

In order to find the right grouping for controllers, think of the testing. (Even if you don't actually do any testing, thinking of how you would go about testing your controllers will give you some very good insights on how to structure them.) An AuthenticationController is not testable by itself, because it only contains functionality for logging in and ...


2

This is an ancient debate really. It goes all the way back to the first databases and the notion of "referential integrity", which in turn is a variation of the strong-typing / weak-typing debate. Who's job is it to make sure that data is stored in a consistent and "known good" manner? MVC purists will tell you it's the controller's job. Database ...


1

Very purpose of ViewModel is to covert and display the data in your model to match the view. Simply creating a ViewModel per view would be the best way to handle this.


1

Is this your basic model, sorry, not sure if I understand your text: Hardware_table(Id, GUID, Description, etc) this holds your primary object one of each Document_info_table(Id, HId, Name, size, mime type) this holds documents related to primary object Using SQL you would have to link Hardware_Table to Document_Info_table by inserting the PK from the ...


1

Let the View directly subscribe to the ObjectAEvent event. We've now coupled the View into the internals of the Model, which I believe violates the Law of Demeter. I'm pretty sure this also violates the concept of MVC by definition. MVC isn't about total decoupling. It's about avoiding coupling to elements that are unstable. As for Law of Demeter, ...


1

Take maxims such as "thy model shall only care about the database stuff" with a grain of salt. Dogma has no place in engineering. In order to answer this question you need to first understand the nature of this validation array, and whether it fits conceptually with the model or with controlling the model. The fact that these names are stored inside ...



Only top voted, non community-wiki answers of a minimum length are eligible