In a distributed application that has multiple databases that support it, we're looking for better ways to handle the creation of the database connections. For example, suppose your system has three database behind it:
Business Data (orders, products,
categories, etc)
Metadata (data about
the structure of the business data)
User Data (...
Possible Duplicate:
well written java open source projects (for learning)?
I want to improve my design and programming skills by understanding design & code of open source projects. I downloaded hadoop,groovy but they are very difficult to follow. I am not having a clue of how to follow this code without having a high level ov...
Hi All,
Can anyone provide me a sample example of two-way adapter design pattern - and its practical use scenario. My understanding (after reading GOF) is
a. This can happen only in case of class adapters (as opposed to object adapters).
An adapted object no longer conforms to
the Adaptee interface, so it can't be used as is wherev...
Today I had an epiphany, and it was that I was doing everything wrong. Some history: I inherited a C# application, which was really just a collection of static methods, a completely procedural mess of C# code. I refactored this the best I knew at the time, bringing in lots of post-college OOP knowledge. To make a long story short, many o...
I've been trying to create a controller in my project for delivering what could turn out to be quite complex reports. As a result they can take a relatively long time and a progress bar would certainly help users to know that things are progressing. The report will be kicked off via an AJAX request, with the idea being that periodic JSON...
Hi.
I need help to generify and implement the visitor pattern.
We are using tons of instanceof and it is a pain. I am sure it can be modified, but I am not sure how to do it.
Basically we have an interface ProcessData
public interface ProcessData {
public setDelegate(Object delegate);
public Object getDelegate();
//I am sure the...
I've been working a lot with PHP.
But recently i was sent on a work wich use Java. In PHP i used to do a lot of Singleton object but this pattern has not the same signification in Java that it has in PHP.
So i wanted to go for an utility class (a class with static method) but my chief doesn't like this kind of classes and ask me to go fo...
How should I implement items that are normalized in the Database, in Object Oriented classes?
In the database I have a big table of items and a smaller of groups. Each item belong to one group.
This is how my database design look like:
+----------------------------------------+
| Inventory |
+----+------+-...
I know this is the Builder pattern, but it's a modified form of it. Whereas the Wikipedia article on Builder pattern gives the example:
pizzaBuilder.createNewPizzaProduct();
pizzaBuilder.buildDough();
pizzaBuilder.buildSauce();
pizzaBuilder.buildTopping();
Pizza p = pizzaBuilder.getPizza();
Is there a specific name for the modified Bu...
Is there a functional-programming equivalent to the Gang of Four Design Patterns book? That is, is there a book that explains and gives examples of how commonly-needed code structures are implemented functionally? I think seeing that would give me a better idea of how to go about using in practice the functional concepts whose theory I...
I am trying to build the interface of my WEB site using OOP. For this I need to have several objects like menu, thumbnails, contentBoxes joined together to form a complete layout.
I know OOP is not used for presentation but I need to do it anyway. Can anyone help me on this?
...
This is a design question better explained with a Stack Overflow analogy:
Users can earn Badges. Users, Badges and Earned Badges are stored in the database. A Badge’s logic is run by a Badge Condition Strategy. I would prefer not to have to store Badge Condition Strategies in the database, because they are complex tree structure objects...
I'm reading about the State pattern. I have only just begun, so of course I begin by reading the entire Wikipedia article on it.
I noticed that both of the examples in the article have some base abstract class or Java interface for a generic State's methods/functions. Then there are some states which inherit from the base and implement ...
I have a few questions on good programming design. I'm going to first describe the project I'm building so you are better equipped to help me out.
I am coding a Remote Assistance Tool similar to TeamViewer, Microsoft Remote Desktop, CrossLoop. It will incorporate concepts like UDP networking (using Lidgren networking library), NAT trave...
Hey guys,
I follow a module pattern where I instantiate components, however, a lot of time a component will only be instantiate one time (example: a comment system for an article).
For now I instantiate in the same JS file. but I was wondering if it is the wrong approach? It kind of make no sense to instantiate in the same file and alw...
I have a piece of code like this
class Base
{
public:
Base(bool _active)
{
active = _active;
}
void Configure();
void Set Active(bool _active);
private:
bool active;
};
class Derived1 : public Base
{
public:
Derived1(bool active):Base(active){}
};
similarly Derived 2 and Derived 3
Now if i call derived1Object.Configure, i need ...
I am new to design patterns and I have a scenario here. I am not sure as how to implement the pattern.
We have multiple vendors Philips, Onida, etc.
Each vendor (philips, onida, etc) may have different types of product i.e. Plasma or Normal TV.
I want specific product of each vendor using Abstract Factory Pattern.
My implementation ...
I've been racking my brains over inheritance for a while now, but am still not completely able to get around it.
For example, the other day I was thinking about relating an Infallible Human and a Fallible Human. Let's first define the two:
Infallible Human: A human that can never make a mistake. Its do_task() method will never throw an...
Fairly straightforward question:
I know that Codeigniter is a MVC framework - however what design pattern is Codeigniter using?
From first look it seems like Facade, but I could be wrong.
Edit:
Perhaps I should describe Codeigniter for those who don't use it.
In Codeigniter you have a concept of a Controller and a Model, which each h...
Suppose you have an method on an object that given the some input alters the objects state if the input validates according to some complex logic.
Now suppose that when the input doesn't validate, it can be due to several different things, each of which we would like to be able to deal with in different ways.
I'm sure many of you are t...