7
votes
3answers
601 views

How exactly to use the MVC design pattern

I have read the documentation on the apple's developer website which refer following guidelines A view class shouldn't depend on a model class (although this may be unavoidable with some custom ...
0
votes
1answer
83 views

MVC: Where should I store interchangeable algorithms used by the Model (whose names also need to be accessible to the View)?

Please consider a program, where the user chooses an algorithm from a list, and the Strategy pattern is utilized to set this algorithm as the model's operation. For example, an image procession ...
6
votes
2answers
444 views

MVC: my controller seems useless half of the time. Is this a problem?

Often when I design a program with MVC, the controller is useless half of the time. What I mean is this: something happens on the view (e.g. a button click). The view then notifies the controller. ...
4
votes
4answers
411 views

MVC: Does the Controller break the Single Responsibility Principle?

The Single Responsibility Principle states that "a class should have one reason the change". In the MVC pattern, the Controller's job is to mediate between the View and the Model. It offers an ...
2
votes
2answers
121 views

MVC: Controller often simply delegates to Model when notified by View of GUI events. Is this reasonable?

Since I learnt about MVC, I used it for every app I made (which is arguably not the best idea, but that's not the topic of this question). All of them small, 1000 LoC apps. I am using Java and Swing ...
0
votes
1answer
144 views

MVC in a desktop application - can the View ever hold a reference to the Model?

(I'm specifying this is a desktop application so people wouldn't refer specifically to web implementations of MVC). The title says it all pretty much. In an MVC structure - can the View ever hold a ...
-2
votes
1answer
136 views

Best practices in Application's flow diagram [closed]

I make web applications, mostly MVC, object oriented and database enabled. I always have trouble going back to project after a few months of release and work again. I don't even remember what I made ...
1
vote
2answers
234 views

Good Programming Practice for similar child classes

I am developing an iOS application, in which I have to draw some patterns on a view based on option selected by user. Let me explain you more clearly. User will be shown number of images as options ...
3
votes
5answers
1k views

Programming PHP without MVC, classes or framework: rewrite or continue on new features?

I have been programming for several years now, and back then (learning PHP) I've didn't learn to program using classes, MVC-logic or using any frameworks. I found my self solving my problems very well ...
1
vote
3answers
411 views

MVC is a GUI Architecture or a Architecture to GUI and Domain?

Fowler refers to the MVC, as a GUI architecture: There have been many different ways to organize the code for a rich client system. Here I discuss a selection of those that I feel have been the ...
1
vote
3answers
166 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 ...
13
votes
4answers
657 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 ...
1
vote
1answer
135 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 ...
4
votes
2answers
744 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 ...
2
votes
3answers
1k views

Good practice for object instantiation in MVC

In MVC the Domain Models(from Model Layer) should instantiate other Domain Models or all the Domain Models should be instantiate in the controllers and passed down using Dependency Injections? How do ...
4
votes
1answer
400 views

Should I use JavaFx properties? [closed]

I'm usually very careful to keep my Model, View, and Controller code separate. The thing is JavaFx properties are so convenient to bind them all together. The issue is that it makes my entire code ...
1
vote
1answer
141 views

Design pattern for complex view creation in sheet music

I've got a bunch of Note-Models with properties like pitchand duration. In music notation, these notes must now be placed into a certain bar on a certain line on a certain page, and so on. Many more ...
3
votes
2answers
534 views

MVC framework that uses classes instead of methods for actions

In most MVC frameworks, Controller class contains multiple methods, each representing one action. Then annotations and reflection is used to call those methods appropriately. But from OOP point of ...
1
vote
2answers
566 views

Search and Replace in MVC

What would be a good MVC/OOP/GRASP/SOLID structure for a search/replace functionality. Methods: search/searchNext/replace/replaceAll. I'm interested only in the PHP arhitecture and how a professional ...
4
votes
1answer
776 views

The Service class in MVC

From time to time I find there is a need to build a service class. Something I can't really attach inside a model in order to respected GRASP and SOLID. So I created a class called ...
0
votes
2answers
190 views

What is a good technique to prevent unauthenticated users from accessing controller methods?

I have an event(s) controller: class Event extends CI_Controller{ public function index(){ } public function foo(){ } //Shouldn't be able to use this method unless logged in ...
4
votes
1answer
583 views

MVC Pattern - How to get errors from the model to the controller?

Say I have a typical MVC setup. The controller passes on some input to the model, and asks it to do something with it. But the validation of the data fails, or there is some other problem. What's the ...
3
votes
4answers
650 views

mvc pattern on procedural php

First off, I do not have anything against OO programming (I'd be mad if i believed so). But I was thinking on some sort of procedural MVC pattern with PHP; let me explain better. As we all know, ...
1
vote
1answer
97 views

Fitting an established site into a CI framework

I manage a rather large, feature full nightmare of a site which has no end of feature creep settings/options/etc. Up to now its been coded in a procedural/functional way and would like to move to an ...
2
votes
2answers
421 views

What is the difference of delegator and dispatcher?

What is the difference of delegator and dispatcher? I am not quite sure of either concept.
34
votes
14answers
11k views

Isn't MVC anti OOP?

The main idea behind OOP is to unify data and behavior in a single entity - the object. In procedural programming there is data and separately algorithms modifying the data. In the ...
0
votes
1answer
337 views

In PHP, what are the different design patterns to implement OO controllers as opposed to procedural controllers?

For example, it's very straightforward to have an index.php controller be a procedural script like so: <?php //include classes and functions //get some data from the database //and/or process a ...
38
votes
7answers
2k views

How can I get my progress reviewed as a solo junior developer

I am currently working for a 2 person company, as the solo primary developer. My boss gets the clients, mocks up some png design templates and hands them over to me. This system has been working fine ...
1
vote
3answers
812 views

How important is it to implement a caching system in an MVC style framework?

I am writing my own PHP framework (...waits for the groans to subside) for the purpose of learning (best practices, design principals etc.) as I'm entirely self-taught and consequently there are gaps ...
0
votes
1answer
220 views

How Should a model and controller be distributed between subviews of the View?

In many User Interface libraries, we have concept of views and subviews. so according to MVC pattern every view should update the model as soon as it changes. For that view should have a reference ...
2
votes
2answers
3k views

Is this a proper implementation of an iOS MVC pattern?

After browsing the apple docs, I came across this sample of their MVC pattern: Using NSNotificationCenter and without using KVO, would this diagram below represent a correct implementation of the ...
3
votes
1answer
527 views

Rewriting a Procedural PHP App - Should we use a framework?

We have an app that's currently only got about 120 users. The userbase will probably grow by 50% over the next 12 months - but we're going to have to separate storage etc. because we're looking at ...
3
votes
4answers
1k views

Can you call any php model class in an MVC from the controller?

I'm creating a simple MVC at the moment and am wondering if it's 'correct' to be able to call any model class directly from the controller to get the data to send to the view? I have the following ...
2
votes
2answers
120 views

Pattern for user interaction and confirmation

Suppose a FileWriter class that needs validation that it will not erase a file already present, if one is found. It would have two functions: public bool FileExists(string filePath) //... public bool ...
9
votes
3answers
598 views

What is the object-oriented thought process?

I've been studying OOP in conjunction with Zend's MVC implementation for the past few months. I'm pretty new to programming, generally, but I feel strongly that I should learn things the 'right' way, ...
6
votes
8answers
338 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), ...
2
votes
7answers
1k 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 ...
2
votes
4answers
196 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 ...