A design pattern is a general reusable solution to a commonly occurring problem in software design.
0
votes
1answer
40 views
Pattern to use for different Stages in a software
I am developing a software for a laboratory to test some devices. To test each device there are multi subtests which should be done to reach to the final result.To perform a complete test, the ...
0
votes
0answers
22 views
How can I efficiently use BlockingCollection in this scenario
I am designing solution for multi-threaded Producer Consumer problem.
product are very much in numbers (around 100,000) because consumer runs once in an Hour.
there are multiple producer threads and ...
0
votes
2answers
35 views
Is that possible to Inject Func<> to an Event
I am using SerialPort_DataReceived event in my project. But I want to have different Strategies of receiving data inside the body of this event.
I have googled and I found that one way is to inject ...
0
votes
4answers
42 views
Spring Singleton Vs Singleton Design pattern - Class Loader
I know the answer of the question - Spring Singleton Vs Singleton Design Pattern. The answer is that Singleton Pattern has maintains the instance at Spring Container Level, while the Singleton Design ...
0
votes
2answers
74 views
Using statement without specific implementation
I have a class which inherits from WebClient - in some code I am trying to test there is the usual:
using(var client = new SomeWebClient()){...}
Now I don't want to use that SomeWebClient class in ...
1
vote
1answer
28 views
Registering instances of unknown lifetime
Let's assume we have 3 different assemblies
Common assembly
public abstract class ContextBase
{
}
public abstract class ContextManager<T> where T: ContextBase
{
// contains all the ...
0
votes
0answers
16 views
Nested MVC issue
I am using Nested MVCs in my application and its MVCs in a MVC composition.
I have a Task which has 3 parts.
Grid/Table : Displays collection data
Charts : Displays charts for the collection data
...
3
votes
2answers
37 views
The factory class - Design patterns for dummies
From Design patterns for dummies:
There you go — you’ve got a factory class
What I have understood from factory pattern is that it helps us to avoid constant code modification whenever a new ...
2
votes
4answers
33 views
How to initialize all sub NON-Primitive fields of a complex java object when initialize it?
My data model
Class A
fieldA1 : primitive dataType
fieldA2 : primitive dataType
fieldA3 : NON-primitive dataType (Class B)
fieldB1 : primitive dataType
...
-3
votes
2answers
35 views
perl pattern matching non-greedy match for string
I have a string which is like ascv/zxc/zxc-asd/zx.java now I wish to cut the string at second / and get the String value as ascv/zxc.
Similarly I will input the special character type and its level. ...
1
vote
0answers
30 views
Designing a communication system for a program that uses object aggregation
I'm making a Component Based Game Engine, and i try to separate data from logic as much as possible by using this design:
Engine
/ ...
-4
votes
1answer
46 views
best design for a class with specified objects [closed]
I have a class for example MySetting
public class MySetting
{
public string Name {set; get;}
public TileBeh Tile{set; get;}
}
objects of this class are specified. I meanو they are ...
0
votes
1answer
38 views
Wrapping the observer pattern with Cython
The observer pattern appears frequently in my C++ project, which I now want to expose to the Python interpreter via Cython bindings. I tried to construct a minimal example illustrating the situation. ...
1
vote
1answer
37 views
Custom HTML5 validation pattern: YYYY.anynumber
I googled a lot, but I'm stuck.
There is a cool thing in HTML5, required patterns. It's great for emails / phones / dates validation. I use it in my small project for checking numbers. What I need is ...
0
votes
3answers
71 views
Keeping track of objects created by other objects?
Let's say I have a list of objects, objA. Now objA can create more objA, and they will be completely unrelated to one another - they do not care to know about other objA existence in the slightest. ...