Tagged Questions
3
votes
2answers
97 views
Design Pattern Question/Violating OCP
Is there a design pattern I can use for a situation like below. This is an example I made up to try and explain the situation I'm dealing with currently. I keep having to add new DeviceScript ...
3
votes
1answer
240 views
How to add a new feature to this factory model?
The factory should only have the responsibility of creating instances and knowing what types of instances to create, without having the added overhead of knowing about configurations.
With that in ...
2
votes
1answer
122 views
Have I implemented the command pattern correctly?
This is my command interface
public interface IConverter {
void convert();
}
This is my Receiver class
public class Ogg extends Audio{
private File src;
private File trgt;
...
2
votes
1answer
54 views
Content Management System Design Pattern Opinion
I am building game platform content management system where i have the following classes:
Game, GameReview, Video and so on...
Every Game object has list with GameReview objects and every GameReview ...
5
votes
1answer
104 views
Please review following code
Please review the following code. Methods getFirsts and getSeconds return a list of objects which implement CommonInterface and both of them are private. Is it a good or bad design.
@Override
public ...
2
votes
2answers
118 views
best way to use singleton
I know 3 ways for using singleton in our code and I want to know which one is the best way and you prefer more.
The first is to have a Singleton class and every classes that want to be singleton ...
4
votes
1answer
305 views
Is this a good design for a Factory Pattern?
I'm creating a system to generate math problems. As you know in mathematics, there are milles of kinds of problems: Binary problems, fractions, decimals, comparating two numbers, etc.
I'm creating an ...
3
votes
1answer
113 views
How to model this design: BinaryProblem
I'm creating a model for Math Problems. This contains always two properties, and has a CorrectResult method which returns the addition of the two numbers. The propeties data types can be decimal, int, ...
5
votes
3answers
1k views
Review on design pattern
I wrote a framework and I want to hear the thoughts of other on the design patterns it uses. Every method contains three design patterns - adapters(strategy), intercepting filters, and observers.
A ...
1
vote
0answers
1k views
PHP Aspect Oriented Design: Part 2
This is a continuation of this post:
Review on design pattern
What was taken away from that post, and other aspect oriented design is it is hard to debug. To counter that, I implemented the ability ...
1
vote
1answer
141 views
How to add a random feature for a factory design
I'm creating a factory design for math problems. The purpose of the factory is:
The problems must be generated with a certain difficulty (or level). To do this, I've got an abstract method called ...
5
votes
1answer
665 views
How to improve my factory design?
I'm creating a factory design for math problems. The purpose of the factory is:
When the factory initializes, creates in a list some problems (20 initially)
If the program wants more than 20, the ...
4
votes
1answer
104 views
How can I Improve this module?
This module makes a double linked list and initialize each member, I couldn't do it with a loop so I gave up and made each node individually, here is the long output, how can I improve it, or can ...
1
vote
1answer
766 views
Advice on approach to organizing my business logic & data access?
I've been researching various patterns for structuring my business logic & data access, particular in the context of C# and the Entity Framework. I've come up with a basic idea of how I think I'd ...
3
votes
3answers
319 views
Improving the design of this program.
I am trying to design a program that will read a XML file and based on the tag name will perform certain requirements checks. I feel that there is probably a better way of doing this and any comments ...