“Best fit” to avoid reuse of object instances in a collection
Imagine I have a collection of object instances which represent activities for a user to undertake. Dependent on user attributes, I have to randomly select instances to present activities to the user.
Designing a Business Rule Engine
I have a requirement where there are 10 Rules to be applied on data in excel.
If Rule 1 and Rule 2 fails rest of the rules are not checked. But if Rule 1 and Rule 2 passes the rest of all the Rules should be verified and if any errors found- they should be logged. Is there any design pattern which I can use to keep this Rule Engine flexible for adding these 10 rules and Closed for any additional chains in the Current Rule. I was thinking of something like a Decorator Pattern. Will this help me achieve that?
Patterns for a tree of persistent data with multiple storage options?
I have a real-world problem which I’ll try to abstract into an illustrative example.
Learning good OOP design and unlearning some bad habits [duplicate]
Possible Duplicate:
What books or resources would you recommend to learn practical OO design and development concepts?
How to solve cyclic dependencies in a visitor pattern
When programming at work we now and then face a problem with visitors and module/project dependencies.
iOS app with a lot of text
I just asked a question on StackOverflow, but I’m thinking that a part of it belongs here, as questions about design pattern are welcomed by the faq.
Relationship DAO, Servlet, JSP and POJO
I want to implement a JSP
, POJO
, DAO
and Servlet
in my J2EE
program. However, I don’t fully understand how the relationship between these elements should be. Is the following (MVC) setup the right way to do it?
In GSL, why do some functions take a “workspace” argument?
In certain functions in GSL (GNU Scientific Library), some functions take a “workspace” environment as an argument. For example, gsl_poly_dd_taylor
from this page. Why? Wouldn’t it be easier for the function to allocate its own memory, or at least the same difficulty? I suppose that this allows the caller to specify where the function works, but I don’t see how it helps.
Manager/Container class vs static class methods
Suppose I have a Widget class that is part of a framework used independently by many applications. I create Widget instances in many situations and their lifetimes vary. In addition to Widget’s instance specified methods, I would like to be able to perform the follow class wide operations:
When modeling a virtual circuit board, what is the best design pattern to check for cycles?
To make it simple assume you have only AND and OR gates. Each has two inputs and one output. The output of two inputs can be used as an input for the next gate For example: