Well,
I have a problem (ok, no real problem, but I wanna try out something new) with creating objects. Actually I have some orders, which contains a list of orderitems.
These orderitems are used and so spreaded in the whole application, and I need a way to create them. The main problem is, I want to be able to create these objects in m...
I have 3 types of objects: Red, Green, and Blue. I have 3 kinds of devices that handle each type of object, respectively. No device can handle more than 1 type of object. Each "object handler" has a reference to an object which it is currently handling.
In Java I'd do something like this:
public class RedObject {}
public class GreenObj...
I am specifically looking for book which discuss about large scale system design (like Oracle server, Web servers) with extensive use of design patterns and meta programming (templates) in C++.
thank you,
...
I'm struggling for a pattern here. I have quite a few tasks that need to be run, but only need to be run once if they haven't been run before. Everything right now is handled by if/then, booleans and a hashtable. There are also nested children of the same effect (if/then, boolean) so their parent if/then, boolean isn't set to true until ...
Hi,
I have a cache object that caches a number of different types of objects, as illustrated below:
class Cache
{
public:
ObjectTable<ObjTypeA> m_objACache;
ObjectTable<ObjTypeB> m_objBCache;
ObjectTable<ObjTypeC> m_objCCache;
};
The (horrible) way I'm currently using the cache at the moment is directly accessing the cache...
Hi,
I needed to understand the design pattern(s) used in log4j library.
Since it provides loggers for various classes, it it a factory ?
Any more inputs/pointers on these is greatly appreciated..
...
I frequently seems to come up to a situation where I have an abstract type which needs to be processed differently depending on which concrete implementation it has.
As an example, an abstract class Payment could be subclassed as class CreditCard or class StoredCredit. To actually process the payment, we want to use an implementation...
I have a list of validations to run against an object, each a separate method which takes the object as a parameter.
As each validation fails, I will create an appropriate error message.
At the end of the validation process, I will throw a custom exception containing a list of all the error messages.
My question is, I've seen this don...
Is there a preferred method or style of creating a default implementation for interface methods? Suppose I had a commonly used interface where in 90% of the cases the functionality I wanted was identical.
My first instinct is to create a concrete class with static methods. I would then delegate the functionality to the static methods w...
(This question is about the best way to temporarily and programatically keep new records of two databases in sync, having very different schemas, and ignoring the old -outdated and no longer required- records.)
I work on a company that provides TV programming information for guides, newspapers and websites.
I have an old system that ha...
I am a N00b to OO. and people throw flames at me for not answering or not having any points.
what can I say except,I am not qualified!!!
Anyways here is my question
I have seen more than enough examples of inheritance in your classic "Book" samples
Animal, where Bear growls, Cat meows etc...
Let's say I am creating Windows Controls dy...
Hi Stackoverflow, I have a design problem I cannot find a clean and nice solution to. I am developing in PHP but I believe this could occur in any language. My basic problem is that I have two objects that have circular interdependence at some level of indirection. That means I have a class (call it F) implementing the Facade pattern whi...
I trying to write my own Event Aggregation class and i go some articles but i want to go step by step with this pattern, for example i want to create it with 2 simple classes, such as User class and Email notification class, so that when user change his password an email sent to him.
I don't want to care for now with generics, i want it ...
I have an internal application in which one function is containing too many switch cases.
This is developed in php.This specific function is used to write changes to database and also to keep a history of individual field values. So what it does is have a case for each field as different things needs to be applied for different fields...
Hello everybody
I know that each class should to do its own job. So i always try process my fields by only in class's methods.If another class processing on my public fields i feel that there is something wrong but is it always right thing to make define private fields ? Would be bad design or code If i let other classes to change my pu...
Say i have the following two classes:
public class User
{
public int ID { get; }
public string Name { get; set; }
public void ChangeName(string newName)
{
Name = newName;
}
}
public class Mail
{
public void SendUserInfoChangeEmail()
{
t...
I have multiple Controller objects that either execute some script and then redirect to a specific page, or gather some data, send it to a View object and then display that View.
Instead of having a page for each controller instantiation (for example main_menu.php, image_browser.php, manage_users.php), I have an index.php page that cont...
I am trying to implement the event aggregator pattern in a simple way to learn it step by step. But i didn't find any book or nice video tutorial talking about it's implementation.
I just found some good articles such as this http://weblogs.asp.net/rashid/archive/2009/03/05/use-event-aggregator-to-make-your-application-more-extensible.as...
Hi All,
I have a WinForm and few properties that are set on it.
for example : Name,Address are accepted on the Form.
(many more properties in actual example)
The current implementation is somewhat similar to
frmName frmView = new frmName (); //frmName is WINFORM
frmView.Name= "ABC"; //any valid string or read this from file
frmV...
I got this sample http://jfromaniello.blogspot.com/2010/04/event-aggregator-with-reactive.html,
Which describe event aggregator pattern using .net 4.0 but i didn't find in the sample code the ISubject interface and the Subject class and i found the he is using them in the EventAggregator class, is it right to use them like that and wh...