I've recently been bitten by code that uses Inversion of Control when it's not appropriate. Lately, I'm of the opinion that IoC is among the patterns that have the worst effect when misapplied. This is because it tends to create a coupling of classes that can cause a lot of shotgun surgery if you run into a circumstance that's a little...
I'm going to be doing a presentation on unit testing and in doing so I will touch on "design for testability" patterns. In other words using IOC containers, Dependency Injection, avoiding static methods etc.
I have a feeling my team will be cold to starting to code differently to accommodate for testing. So I was wondering if anybody ...
What do you all think is the correct (read: most flexible, loosely coupled, most robust, etc.) way to make user input from the web safe for use in various parts of a web application? Obviously we can just use the respective sanitization functions for each context (database, display on screen, save on disk, etc.), but is there some gener...
I'm new to .Net RIA Services, but I think, its essence, is to target RAD what Microsoft usually cares about. But, does not that introduce more coupling between Presentation and Application/Business Logic? How can this new technology help increasing number of developers who are interested in OOAD Best Practices and concepts like SOLID, GR...
I can set the parent's status bar text with this function I wrote
void EditorWindow::setStatusBarText(const QString& text) {
statusBar()->showMessage(text);
}
Called like this (from child)
((EditorWindow*) parent())->setStatusBarText(tr("%1, %2").arg(mousePos.x(), 0, 'f', 2).arg(mousePos.y(), 0, 'f', 2));
But I'm pretty sure th...
In MVVM, The ViewModel is a model for the view. And the real power comes in when we bind ViewModel to View in WPF.
However, if third party control does not support data-binding (not supporting all functionality), in that case is it worthwhile to use MVVM?
...
Which pattern could be used in web projects?
I am developing a wiki project with ASP.NET. In my structure every wiki entry could have
comments.
Which way is the best :
wikiEntry.AddComments(newComment);
wikiEntry.Comments.Add(newComment);
entryManager.AddComment(wikiEntry, newComment);
...
I wish to make controls like textbox, combobox, listbox and other user editable controls to be bound with validation, so i thought of extending the existing controls and make a new VTextBox, VComboBox, VListBox which have a validationregex property and an error provider component attached with them. My prime aim is to have validation att...
Would Like to know how best to implement the Presentation Model pattern. I have read about MVVM but does not apply to me as I'm not using Silverlight or WPF.
...
So what exactly is Django implementing?
Seems like there are
Models
Views
Templates
Models = Database mappings
Views = Grab relevant data from the
models and formats it via templates
Templates = Display HTML depending on data given by Views
EDIT: S. Lott cleared a lot up with this in an edit to a previous post, but I...
My colleagues are going crazy because i keep on wanting to rewrite code that already works because i would like to replace some legacy design with design pattern. Although i feel like it will help improve the existing code, I do feel like i am getting a little paranoid about it and try to use them everywhere and even replacing one design...
I'm building a set of CRUD screens for a Repository. The member objects are large enough that I'd rather not load lots of them into memory all at once - as when generating search results.
Since all I need for search results are a couple of properties - e.g., "name" and "id" - I could just query the underlying database - but I don't want...
We are making a game with a playing character that will have several different states. In most examples I see a switch statement in the controllable charactor based on the state. Is this the standard way that things are done for most games? Or is it better to create a set of states that handle the animation and logic of that state. It se...
Update
Sorry. I didn't mean the whole reflection library was off limits. I just meant the insanely slow *.Invoke() stuff.
Hi,
I need to implement a property system in C# that allows both normal property access
[property_attribute()]
return_type Property { get; set; }
and access by string
SetProperty(string name, object value);
obje...
Background:
I am an intermediate web app developer working on the .Net Platform. Most of my work has been defined pretty well for me by my peers or superiors and I have no problem following instructions and getting the job done.
The task at hand:
I was recently asked by an old friend to redo his web app from scratch. His app is extreme...
I recently worked on a .Net WPF project to build a retail point of sale system where I used the MVP pattern for the first time. It took me a little while to wrap my head around the change of approach but once I did that I thought that the concept rocked!
My question is this: what is the distinction between MVC, MVP and MVVM? If there is...
I am trying to understand Adapter patter and its use in real world. After going through various articles on internet and www.dofactory.com, I created this sample code. I just want to know whether my understanding is correct. In the sample below I have created MSDAO object in the Adaptor class. Later I changed it to OracleDAO.
class Clie...
If someone has created a small diagnostic, internal web app that uses (unit) tests as its logic, is there ever a valid reason to do that? Keep in mind that Nunit has to be deployed as well where ever this website goes.
I'm of the view that programs should contain their own logic and possibly reusable parts (if available) but not wrap t...
We have a class that holds configuration information for the application. It used to be a singleton. After some architectural review, we were told to remove the singleton. We did see some benefits of not using singleton in the unit testing because we can test different configurations all at once.
Without singleton, we have to pass the i...
In an ASP.NET MVC application implementing the repository pattern I am curious if it is appropriate to place non-data related methods in the repository if they still pertain to the general focus of a given repository. For example, suppose a ProductsRepository that has methods for adding and deleting ProductImages which have a partial rep...