MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.
1
vote
3answers
113 views
Law of Demeter in MVC regarding Controller-View communication
The scenario: Having a Controller that controls a view composed of complex subviews.
Each one of those subviews is a separated class in a separate file. For example, one of those subviews is called ...
0
votes
0answers
27 views
Updating query results
Within a DDD and CQRS context, a query result is displayed as table rows. Whenever new rows are inserted or deleted, their positions must be calculated by comparing the previous query result with the ...
2
votes
1answer
89 views
Is it bad practice to call a controller action from a view that was rendered by another controller?
Let's say I have an OrderController which handles orders. The user adds products to it through the view, and then the final price gets calculated through an AJAX call to a controller action.
The ...
13
votes
4answers
501 views
Switch vs Polymorphism when dealing with model and view
I can't figure out a better solution to my problem. I have a view controller that presents a list of elements. Those elements are models that can be an instance of B, C, D, etc and inherit from A. So ...
2
votes
2answers
109 views
Permissions and MVC
I’m in the progress of developing a web application. This web application is mostly a CRUD interface, although some users are only allowed to perform some actions and see only some parts of views.
...
4
votes
4answers
160 views
Business rule to display data in all uppercase - how to handle?
Part of a system I am working on manages some securities information (stocks, bonds, etc...) and business rules specify certain fields be displayed only in all CAPS (stock symbols and CUSIPs for ...
0
votes
2answers
120 views
ASP.NET MVC create a draft without persisting to DB
I have a requirement to allow users to suggest updates to their profiles on a site I'm working. They would be able to view their profile details, then click on and "edit" button, which would basically ...
2
votes
2answers
210 views
Best Practices PHP mvc routing
I have a custom MVC framework that is in a constant state of evolution. There's a long standing debate with a co-worker how the routing should work. Considering the following directory structure:
...
4
votes
2answers
318 views
.NET MVC project architecture / layering
When planning the architecture for a mid-large scale MVC web application how do you implement the layers to be as decoupled as possible and easy to test? (basically follow best practices) Let's say ...
4
votes
2answers
276 views
Managing threads in Java with a good pattern
This morning I began writing a minimal chat using Java socket and threads but it took some minutes for me to experience a lot of problems in the MVC management.
Currently I have 3 classes:
Main, ...
1
vote
1answer
192 views
Java desktop application using MVC + Hibernate
I'm developing a Java desktop application. I'm planning to use MVC architecture described at Oracle site: Java SE Application Design With MVC.
I need to store data in database so I decide to use ...
1
vote
2answers
172 views
Use a service layer with MVC
If a controller gets to fat and model instantation starts to add up a service layer could be used.
If I just wrap the logic inside a service class I will get a bunch of Services with one/two ...
1
vote
2answers
75 views
MVC Models instantiation
Where should the Models be instatiated in a MVC arhitecture? I understand the preferred way would be outside controllers, in a bootstrap file and injected using a Dependecy Injection Container. But ...
1
vote
1answer
62 views
how to model a connection to a resource, with rudimentary event processing
For my simple MUD client I'm using Apache Telnet (no, not ssh). A mud client is a strange beast:
Generally, a MUD client is a very basic telnet client that lacks VT100 terminal emulation and the ...
3
votes
2answers
468 views
How does MVC work with the principle “Tell, Don't ask”?
Procedural code gets information then makes decisions. Object-oriented
code tells objects to do things.
— Alec Sharp
So, when a view wants to display some information that is suppose to be ...