We have a class, say LegacyUserSettingsService. LegacyUserSettingsService implements an interface, IUserSettingsService.
You can get an instance of the IUserSettingsService by calling our ApplicationServicesFactory. The factory uses Spring.NET to construct the concrete LegacyUserSettingsService.
The trouble is that new developers some...
In Java IoC / DI is a very common practice which is extensively used in web applications, nearly all available frameworks and Java EE. On the other hand, there are also lots of big Python web applications, but beside of Zope (which I've heard should be really horrible to code) IoC doesn't seem to be very common in the Python world. (Plea...
Just got done with "The art of unit testing". It was a great read and i think everyone should go buy a copy. With that said i think the next book I'm like to read would be a architecture / Design type book that would focus heavily on building your objects / software in such a way that it would be:
Low Coupling
High Cohesion
Easily Ma...
i'm facing the problem of the view showing data that's not in the model, and the model containing data that isn't in the view.
Imagine the data model has a birth date field:
DateTime: BirthDate;
And the view lets the user enter a birth date:
Birth Date: 11/28/1973
And that date goes into the model via the controller and all...
Hello. I have only one class with many instances. Every instance is observer of couple of other instances. As well every instance can be observable by couple of another instances.
How to avoid infinite loop of calling update() in observers?
...
I'm creating a small framework for my web projects in PHP so I don't have to do the basic work over and over again for every new website. It is not my goal to create a second CakePHP or Codeigniter and I'm also not planning to build my websites with any of the available frameworks as I prefer to use things I've created myself in general....
What is the "dispatcher" pattern and how would I implement it in code?
I have a property bag of generic objects and would like to have the retrieval delegated to a generic method.
Currently, I have properties looking for a specific key in the bag. For example:
private Dictionary<String, Object> Foo { get; set; }
private const String...
I'm looking for web sites, books, or other resources that provide a catalog of object designs used in common scenarios. I'm not looking for generic design patterns, but for samples of actual object designs that were used to solve real problems.
For instance, I'm about to build an internal messaging system for a web application, similar...
I just inherited some code, two threads within this code need to perform a system task. One thread should do the system task before the other thread. They should not be performing the system task together. The two threads do not have references to each other.
Now, I know I can use some sort of a semaphore to achieve this. But my questi...
Is it a common pattern/idiom to use free functions as pseudo-constructors to avoid having to explicitly specify template parameters?
For example, everyone knows about std::make_pair, which uses its parameters to deduce the pair types:
template <class A, class B>
std::pair<A, B> make_pair(A a, B b)
{
return std::pair<A, B>(a, b);
}
/...
First, I'd like to say that I think this is a common issue and there may be a simple or common solution that I am unaware of. Many have probably encountered a similar problem. Thanks for reading.
I am creating a GUI where each component needs to communicate (or at least be updated) by
multiple other components. Currently, I'm using a S...
We have a serial port which is connected to hundreds of physical devices on the same wire. We have protocols like Modbus and Hart to handle the request and response between the application and devices. The question is related to managing the reference count of the channel. When no device is using the channel, the channel should be closed...
Just to keep things interesting and close my final open question, the solution that implements the below functionality in a nicely organized manner with a decent architecture gets a good bounty. The full code is on jsfiddle, and feel free to ask any questions :)
How do you usually organize complex web applications that are extremely r...
I've seen a lot of codes use a service-dao pattern , I don't know the origin of this pattern . It force the front layer call service , then delegates some of the service task to dao.
I want to ask :
Does DAO layer do purely data access related task ? What about things like exception encapsulation?
Is there any other pattern can be ...
Is MFC is based on any design pattern,if so which design pattern??
...
Hi,
I was just after peoples opinion on when the best time to save an object (or collection of objects) is. I appreciate that it can be completely dependent on the situation that you are in but here is my situation.
I have a collection of objects "MyCollection" in a grid. You can open each object "MyObject" in an editor dialogue by dou...
I was wondering, why do static Create methods exist?
For instance, why use this code:
System.Xml.XmlReader reader = System.Xml.XmlReader.Create(inputUri);
over this code:
System.Xml.XmlReader reader = new System.Xml.XmlReader(inputUri);
I cannot find the rationale for using one over the other, and can't find any relation between c...
Background, I am extending the ASP.NET Membership with custom classes and extra tables.
The ASP.NET MembershipUser has a protected constructor and a public method to read the data from the database. I have extended the database structure with custom tables and associated classes.
Instead of using a static method to create a new member...
Problem Description:
We have a requirement to store the snapshot of an entity temporarily in the database until a certain period of time until all the processes to approve the data are completed. Once all approvals are completed the data shall be permanantly persisted into the actual table.
Example:
Consider an entity called "User". O...
I'm learning about design patterns and in examples of code I've seen a convention where the abstract class declares a method, for example:
public abstract class ServiceBase {
...
public virtual object GetSomething();
and then
protected abstract object DoGetSomething();
My question is on why these two methods exist, since they app...