Questions tagged [mvc]
MVC (Model-View-Controller) is a software architecture pattern that enforces separation of concerns.
935
questions
7
votes
1
answer
399
views
MVC framework seems to suggest creating possibly hundreds of .aspx or .cshtml pages. How do I avoid this?
So, I was playing around with MVC3. Correct me if I'm wrong but based on all examples I've seen, it is suggested that you pretty much have a page for every model and Action from the Controller. So ...
11
votes
5
answers
976
views
When to use MVC
I'm building a site with PHP and a MySQL backend. But, I am currently not using any type of framework. Should I be using Model View Controller?
6
votes
4
answers
1k
views
When developing a MVC web application should views or models be created first?
I have to build a new application from scratch, so I want to implement it using MVC3 and try to follow general best practices as closely as possible. However, I'm developing it as a one man army. ...
3
votes
2
answers
499
views
Use controller in view in MVC
I have a problem convincing my team mates why we shouldn't use (directly reference) the controller in the view when developing components in the spirit of MVC.
I have invoked decoupling and natural ...
5
votes
4
answers
397
views
What's the correct approach for passing data from several models into a service?
I have an AccountModel and a page where the user can upload a file. What I would like to have happen is when the user uploads the file. The PageController does something like the following. this is ...
18
votes
7
answers
11k
views
Do experienced Ruby on Rails developers use scaffolding?
In the Ruby on Rails tutorial, I read something that suggested that experienced developers do not use scaffolding since they tend to like to just write the code to connect the MVC on their own.
In a ...
19
votes
7
answers
8k
views
How do you organize your MVC framework while supporting modules/plugins? [closed]
There are a two main codebase structures that I have seen when it comes to MVC frameworks. The problem is that they both seem to have an organisational bug that goes with them.
Standard MVC
/...
4
votes
1
answer
349
views
What is the best practice to develop a visual component in Flex Hero?
What is the best practice to develop a visual component in Flex Hero?
I do it like this:
I consider a component has 2 "parts", the declarative part (the visual sub-components) which I define in the ...
10
votes
3
answers
2k
views
MVC : Fully populated models or Partially Filled Models?
This one has haunted me for so long. When doing MVC programming what do you think is the better programming practice? Should one use fully populated models or the partially filled ones, especially ...
4
votes
2
answers
9k
views
In MVC where do you put action methods for views in the shared directory?
I have a website built using a MVC.NET framework with C# that uses some shared views and partial views. In order to display the views properly there is a bit of code that must reside in the ...
6
votes
8
answers
470
views
What benefit do I get from good methodology?
One of my friends has worked for nearly 10 years, asked me why he needs to learn new things such as unit-testing, MVC, Multi-tier architecture (he creates 3-tier application but designs like 2-tier), ...
18
votes
4
answers
26k
views
One controller per page or many pages in one controller?
I just wanted some advice regarding the MVC way of doing things. I am using codeigniter and I was wondering if it's better to have one controller per page for a website or to have one controller for ...
3
votes
3
answers
914
views
How to show someone of the power of model-view-controller design pattern?
I've been working with a friend on a project that we've taken over, and I've realized that we have a big problem implementing the model-view-controller design pattern due to the way that the project ...
24
votes
2
answers
11k
views
Alternative patterns for web development? (non-MVC) [closed]
Recently I've been reading some blog posts regarding MVC and how it doesn't fit the web. I've learned about alternative patterns like the RMR Architecture.
I'm curious what other patterns people are ...
2
votes
1
answer
160
views
How to output library test/benchmark data in a web framework?
I am writing an MVC framework. I have a folder full of library classes, each are self contained, and could be ripped out of the framework and used by themselves. The only problem is that a few of ...
0
votes
1
answer
388
views
Evolution of my MVC design with new UI complexity
I have a desktop instrumentation application in MVC. Currently I had 2 versions of the application, thus 2 views and 2 controllers, each having common code in a base class. The views react directly to ...
10
votes
1
answer
14k
views
If you have a piece of logic that needs to be shared between two controllers where do you keep it?
I have a set of single purpose functions that I need in two separate controllers. Right now I just have duplicate code and I want to get rid of it. This code is part of the controller and doesn't ...
17
votes
5
answers
3k
views
MVC, WCF, EF, LINQ - Is it just me? [closed]
...or are things getting more complicated?
It seems to me that you need to know a lot of stuff to 'properly' develop an MS web app these days. In the bad old days when we didn't know any better we ...
3
votes
7
answers
2k
views
Architectural patterns for interaction beyond MVC? [closed]
We all know the venerable Model-View-Controller pattern used to design interaction [mostly] with human users. It is the de-facto standard in OOP environment.
What are some other architectural ...
1
vote
4
answers
4k
views
When designing an application around Model-View-Controller (MVC), what is in your toolbox?
There are a lot of great explanations for what the Model-View-Controller design pattern is, but I am having trouble finding good resources showing how to use it in practice.
So, when you are starting ...
6
votes
2
answers
1k
views
Observing MVC, can/should the Model be instantiated in the ViewController? Or where?
I'm writing an experimental iPhone app to learn about the MVC paradigm. I instantiate my Model class in the ViewController class. Is this stupid?
I'm asking because storing the id of the Model class, ...
13
votes
4
answers
6k
views
Explain Model View Controller
My experience with developing dynamic websites is limited mostly to Java servlets. I've used Tomcat to develop various Java servlets, and I wouldn't hesitate to say that I'm reasonably proficient ...
3
votes
3
answers
699
views
MVC and individual elements of the model under a common base class
Admittedly my experience of using the MVC pattern is limited. It might be argued that I don't really separate the V from the C, though I keep the M separate from the VC to the extent I can manage.
I'...
2
votes
4
answers
219
views
Models, controllers, and code reuse
I have a blog where users can post comments.
When creating a comment, various things happen:
creating the comment object, associations, persisting
sending notification emails to post's author given ...
2
votes
1
answer
936
views
I'm creating my own scalable, rapid prototyping web server. How should I design it?
I'm going to create my own web server that focuses on scalability, rapid prototyping and the use of JavaScript as the server's scripting language, much like node.js. It will use a Model-View-...
5
votes
5
answers
10k
views
What file extension do you use for your template/view files in PHP? [closed]
I'm building a Model-View-Controller framework, and it has come time to decide how I will be creating and using view templates and layouts.
Some frameworks use special extensions for these files. ...
7
votes
5
answers
4k
views
MVC Pattern, ViewModels, Location of conversion
I've been working with ASP.Net MVC for around a year now and have created my applications in the following way.
X.Web - MVC Application Contains
Controller and Views
X.Lib - Contains
Data ...
3
votes
2
answers
3k
views
Unobtrusive JavaScript (regarding asp.net mvc3) not clear
Unobtrusive JavaScript avoids injecting inline JavaScript into HTML. This makes your HTML smaller and less cluttered, and makes it easier to swap out or customize JavaScript libraries
http://www.asp....
5
votes
1
answer
570
views
Examples of different architecture methodologies
Is there a resource or site which illustrates building the same application (desktop or web) using several different contrasting architectures? Such as MVP versus MVVM versus MVC, etc. It would be ...
1
vote
5
answers
2k
views
Is MVC now the only way to write PHP?
Hey... its XMAS Eve and something is bugging me... yes, I have work on my mind even when I am on holiday. The vast amount of frameworks available for PHP now use MVC. Even ASP.net has its own MVC ...
47
votes
6
answers
28k
views
How much business logic should be allowed to exist in the controller layer?
Sometimes we have some business logic represented in the controller code of our applications. This is usually logic that differentiates what methods to call from the model and/or what arguments to ...
5
votes
1
answer
338
views
MVC for our application?
There are some issues about how to manage our program designs and programming styles. I was assigned to find a solution to write reusable code - though, the programming team does not follow the rules.
...
5
votes
2
answers
9k
views
Python MVC framework for desktop applications
I'm used to program with Python and GTK using pygtk library.
I feel like my programs are not well separated according to MVC model.
I think following a framework it would help me to design better ...
11
votes
4
answers
7k
views
Why would you use MVC over Web Forms?
Recently an architect described our company as offering a Rolls-Royce solution (MVC) when all he needed was a Toyota (Web Forms).
I'm curious to find out what you think about web forms vs MVC as an ...
9
votes
4
answers
3k
views
Is MVC just the SEO of PHP programming?
There's around a zillion "PHP frameworks". And most of them bill themselves as following the MVC pattern. While it's welcome to overcome osCommerce coding style (processing logic heavily intermixed ...