In software engineering, a design pattern is a general reusable solution to a commonly occurring problem within a given context in software design. A design pattern is not a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that ...
0
votes
0answers
8 views
How to Decouple a Custom ListCellFactory From Controller?
I'm writing a UI with JavaFX 2.1. It looks like this:
So far so good. For the right list I have some custom elements- questions I want the user to answer. It's a string with three Comboboxes that ...
2
votes
1answer
73 views
How is the design of this Singleton implementation
I did this as an exercise just to practive/improve using generics.
Independent of how useful this implementation of a Singleton is, how is my coding in terms of using generics and any other aspect of ...
0
votes
0answers
34 views
Does this code follow loose coupling pattern or should be refactored/re-designed?
I've to adming i don't like this design.
The main class (SMSHelper) is responsible of query a REST web service which in turn returns an XML string. This helper is going to return a new SMSCreditInfo ...
8
votes
2answers
120 views
Replacing Python Classes with Modules
I try to avoid using classes in Python as much as possible; if I don't plan on building on it, I don't build it in the first place. It helps me avoid Java-like classes like FileDownloader(), when I ...
3
votes
2answers
149 views
Best practices for decouple classes in C#
So this is a lot more confusing than it has to be (I could just stick all of this in the main class with the ui event handlers) but I wanted to decouple this class for learning purposes.
Basic ...
2
votes
4answers
147 views
Priority queue implementation in C#
My application has a thread for handling database inserts and updates. Data is added by other threads to a generic queue in the DB thread. The contents of this queue is retrieved and is sequentially ...
2
votes
2answers
92 views
Is Factory Pattern implemented good in this way?
Suppose I have this code:
public interface BaseType {
public void doSomething();
}
public class ExtendedTypeA implements BaseType {
//No Instance Variables
@Override
public ...
0
votes
1answer
153 views
Implementing RSA in C++
I am implementing RSA algorithm in C++ and here's my design(code structure).
keygen.h
namespace rsa{
class keygen{
public:
//Constructor
keygen(size);
//Generate ...
2
votes
1answer
117 views
Design+code review of an implementation of Dijkstra's shortest path algo
this is my code that implements dijkstra's single source shortest path algorithm (as submission to a coding forum hence tag:homework) which is called multiple times to recalculate after graph changes. ...
1
vote
1answer
52 views
PHP - Is this proper use of exceptions for error handling within classes?
I've searched plenty on this topic and have gotten a lot of good (but different) results. Some of the results weren't quite related and it does seem to be a matter of preference in the end, but I'm ...
0
votes
3answers
88 views
Music Jukebox object oriented design review [closed]
I'm trying to improve my OO design skills and hence trying to work on the below problem -
Problem Statement - We need to design a musical jukebox for a university where students can access the ...
4
votes
1answer
201 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
119 views
non blocking high performance message processor in java
I have some kind of high thoughput message handler receiving ordered messages. Now the task is - adding monitoring stuff in it in order to recognize wrong input messages, more exactly: it must notify ...
1
vote
0answers
94 views
Separate responsibilities out of this class that uploads data to a post URL
At the moments the requirements do not need me to change this code, however I think there is something wrong with it in the fact that it seems to know too much. The code takes a memory stream which ...
2
votes
1answer
49 views
Registering layers in a web mapping library. API design
I am working on a web mapping library, that makes it possible to create a map with SVG and JavaScript. As every map shall consist of SVG and Image elements, which can be grouped in layers, which in ...