Hello!
Sadly, I can't remember where I read it, but...
...in C++ you can derive a class from a template parameter.
Im pretty sure it was called
Feature Oriented Programming (FOP) and meant to be somehow useful.
It was something like:
template <class T>
class my_class : T {
// some very useful stuff goes here ;)
}
My questions abo...
This question is kind of continuation to my earlier post: http://stackoverflow.com/questions/944824/visitor-pattern-implementation-in-java-how-does-this-look
I got a bit confused while refactoring my code. I am trying to convert my visitor pattern (explained in the prior post) into a composite strategy pattern. I am trying to do somethi...
Hi,
In days of ajaxish Web2.0 I wonder whether it is possible to create 100% barrier-free web pages or if there are even patterns to support common Web2.0-practices.
What came to my mind is drag&drop. Is there an all-round solution for this or does it depend highly on the way the technique is used?
Thanks!
...
I have to use a GUI Element that draws a picture at a specific screen position.
If the user selects this picture there is a border drawn around the Image.
Now we want to include another border that identifies pictures with a specific value for the user.
At the moment the Element looks at his internal state if it is selected and then ...
A cousin is going to college, probably in computer science, and he asked me where is a good school to go. I told him some schools and current topics in CS, he asked about them and I was wondering, are there some colleges that actually put Design Patterns, CSS, JavaScript, Ajax, DOM Scripting, XML, and web architecture in their required ...
Consider a database with tables Products and Employees. There is a new requirement to model current product managers, being the sole employee responsible for a product, noting that some products are simple or mature enough to require no product manager. That is, each product can have zero or one product manager.
Approach 1: alter table ...
We all know the observer pattern: You have a subject which is able to notify and update a list of observers of its state changes. Now suppose that the subject you would like to observe is a container, and you would like to observe the container itself, i.e. element addition and deletion of elements, and also the contained elements, i.e. ...
I'm thinking of implementing the state design pattern on an ASP .NET Webform.
The state would be determined by the query string passed to the page. Based on the state of the page, any action would call the method on the concrete implementation.
What I am trying to achieve is a page that can handle any number of different implementation...
Why would you ever use interface it you are going to have only one implementation of it?
...
I am looking to set up a central point of control for settings that exist across several web servers, server applications, and possibly even internal desktop tools.
The current situation is that I have a settings file on each webserver or within each application, with Global Variables defined: Admin Email, Where to store uploaded files,...
I'm implementing a decorator pattern in Javascript.
I've seen the example here in Wikipedia
// Class to be decorated
function Coffee() {
this.cost = function() {
return 1;
};
}
// Decorator A
function Milk(coffee) {
this.cost = function() {
return coffee.cost() + 0.5;
};
}
// Decorator B
function Whip(coffee) {
...
I am often tasked with processing a list of tasks. Usually, this requires me to go fetch something programmatically and store it somewhere (database, file share, ftp, etc). Then I have to process the text file, xml, sql result set, or whatever it is, and store my results.
For example:
I have a database that details a list of a bunch o...
If my objects are for the most part simply holding data that will be sent to the View, does it make sense to implement a separate Service class to initialize object, retirve data and make assignments? Instead, shouldnt the object 'know' what it has to do when it is instantiated, and thus make appropriate calls to repository as needed?
...
I'm looking for design patterns (GOF, but others would be welcome too) for Delphi 2009.
There are some very good and classic articles about Design Patterns in Delphi:
http://www.obsof.com/delphi_tips/pattern.html, by James Heyworth (1996)
http://blogs.teamb.com/joannacarter/, by Joanna Carter (until 2004)
Additionally, the newer Del...
jQuery uses this pattern. Essentially it involves every method returning a reference to the same object on which the method was called.
myClassInstance
.DoMethodA()
.DoMethodB()
.DoMethodC()
.CleanUp();
What's this design pattern called?
UPDATE
The accepted answer is correct, and here is the link to the wikipedia entr...
Hello!
I have two classes (A and B) which depend on each other in following sense:
Each class has a method performing some action.
The action of each class depends on an action of the other class.
So, if the user calls action of class A, it should automatically call
action of class B.
Same for the other way. But an infinite loop should...
Does anyone know if the Facade pattern is used anywhere in the .NET FCL?
Thanks
Clarry
...
There has been a fair bit of talk/debate lately in the Zend Framework community about thin controllers. Apparently there is a tendency of ZF users to view the Model as nothing more than the gateway to the database.
The argument is that Models should be "fat" and do more of the work and Controllers shouldn't be chaining methods and doin...
Is the Strategy Pattern based largely on the fact that there will be change to the software?
1) So in today's environment, what if the change is total unknown and unforeseeable yet. At that point, will the Strategy Pattern be not appropriate to be added (at that moment)?
2) What if the Program Manager wants it done in 2 days, or ASAP ...
i'm trying to wrap my head around how to enterprise up my code: taking a simple routine and splitting it up into 5 or 6 methods in 3 or 4 classes.
i quickly came up three simple examples of code how i currently write it. Could someone please convert these into an MVC/MVP obfuscated version?
Example 1: The last name is mandatory. Col...