Relative Content

Tag Archive for design-patterns

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?

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: