I am interested in the design patterns that where used in the development of wcf. As an example of what I am looking for: the ChannelFactory class is used to create the channel between the client and the service; does this represent an implementation of the Abstract Factory pattern or the Builder pattern? Or a combination of the two? ...
Has somebody tried any tools for design patterns recognition in source code?
I'm looking for one that is more or less effective and expects some reasonable input (for example, an xmi file produced by a reverse engineering tool or another data that can be easily generated from the source code).
I've found some academic tools like CrocoP...
I want to do following, I am writing Graph library. I want my class should be template.
template < typename T>
class Graph
{
}
This Graph class works on another class Vertex
How should I design this Vertex class so that any of my team members can use and I do not have to change my implementation in class Graph
Basically I want this ...
We are currently using the decorator design pattern to perform some caching. So we have a bunch of classes that look something like this:
interface IComponent
{
object Operation();
object AnotherOperation();
}
public ConcreteComponentA : IComponent
{
public object Operation()
{
return new object();
}
public object Anoth...
Suppose you have a profile for an application. This profile stores some data specifically about one user. You can persist the details of the profile and pull them back each run.
Does a profile make a good candidate for the State pattern? If not, is there a good heuristic to model this sort of functionality?
...
Hello,
I'm currently developing an application in which I'm using a plugin system. For providing unified access to a configuration screen I added a settings class to each plugin which must implement a settings interface. Furthermore each Settings class should implement the singleton pattern as shown below:
public sealed class PluginSet...
I am using Rails 3.
The main model is Product
:product has_many :images
:product has_many :related_products (self-referential)
:product has_many :descriptions
:product has_many :specifications
:product has_many :upc_codes
:product has_many :prices
You get the idea. I'm trying to determine if I can shoehorn this into a properties mod...
I have the follow classes (C# for example)
class A
{
private static Dictionary<int, A> idLookup;
....
private A(id) {...}
public static A Get(id)
{
//does some magic
if (...) { return idLookup[id]; }
else { A a = new A(id); idLookup[a.id] = a; return a; }
}
}
class B
{
private static...
This is more of a design question.
The requirement is to have a winform with multiple buttons. Each button may either open another form with multiple buttons or open a function form e.g. add orders etc. So basically we have menu forms (made up of buttons) and function forms (the functionality the app provides).
Because this is a produc...
I'm writing a simulation in Python for a dice game, and am trying to find the best way to handle the following situation in an Object Oriented manner.
I have a Dice class that handles rolling the dice and reporting things about the dice. This class's methods include a roll() method which modifies the dice values, and various reporting ...
I'm trying to develop web application (php/mysql), sort of blog site where ~10 posts are listed on front page. Only first 4-5 lines of each post are displayed and when user clicks the title it opens new page with full post displayed.
Users will use TinyMCE to post with very limited functionality, so bold, italics, underline, undo/redo a...
I'm refactoring a bunch of old code. My primary objective is to decouple the behavior from the database. The current implementation accesses the database directly which makes it hard to test and do things like implement caching layers etc... Up until this point I've been using a combination of dependency inversion and readers/writers ...
Hi,
I have a set of classes that have dependencies at instantiation time, that is, when creating an object of type A, it also creates another of type B, which subsequently creates others of type C, etc.
For testing matters, I don't need the whole functionality of all the levels to test the upper ones, so I could use stubs or mocks, bu...
I had not done with any OO in the past in projects, as I kept it simpler (in fact using archaic mysql_query calls and my own filtering) so I wanted to start a new project, learning to use design patterns with my OO along the way.
I was looking to build a microblogging site for kicks, and found the Singleton design pattern class which se...
After doing some reading on the Model View Controller pattern it seems that the pattern is implemented quite differently in web frameworks vs desktop frameworks. With web based MVC frameworks the view and model never communicate directly. They can only communicate with the controller. But in desktop implementations, it seems that the vie...
I have a multistep process where each step does some network IO (web service call) and then persists some data. I want to design it in a fault tolerant way so that if the service fails, either because of a system crash or one of the steps fails, I am able to recover and re-start from the last error free step.
Here is how I am thinking o...
I'm looking through some old code and realize there are a ton of "helper" methods in this class as well as a ton of fields that are set via dependency injection and configuration. All of these things are essentially used by one very important method in the class. Is there a proper term for this in software development? Can I refer to ...
Lets say I'm designing a website where we have English, French, Spanish, German, and Korea (I'm not, but lets pretend I am).
I cannot rely upon services such as google translate, as the nature of the website is not for entertainment but business. Lets say I have access to professional translators that can translate something in context ...
Hi Guys,
Here's the scenario:
ASP.NET MVC2 Web Application
Entity Framework 4 (Pure POCO's, Custom Data Context)
Repository Pattern
Unit of Work Pattern
Dependency Injection
Service Layer mediating Controller -> Repository
So basically, all the cool stuff. :)
Flow of events for a basic UI operation ("Adding a Post"):
Controller c...
When I make an object to use in NIB, the object should implement -initWithCoder:. However I can't figure out regular pattern implementing this.
I have been used this code.
- (id) initWithCoder:(NSCoder *)aDecoder
{
if(self=[super initWithCoder:aDecoder])
{
// initialize my object.
}
return self;
}
But I have to make same cod...