I am working on a safety-critical multi-user system where data shown to the operator can be changed by other operators or external systems. These changes need to be highlighted in the UI and then acknowledged by the operator. Anyone aware of existing UI design pattern that captures this need?
...
I didn't find any info on searches when I looked this up. I've been doing a lot of research on design patterns but I haven't seen anything as far as routing goes. What I mean is this: back in my php days I would write code on one page and then pass it to the next. That created (though I wasn't aware of it at the time) tightly coupled cod...
Hello, i'm currently constructing some kind of mini-framework for a project, and come up with this solution. I have tried many of them, but this seems to me very convinient (code is shortened for simplicity):
# Basically it's just a Registry pattern
class Repository {
private static $objects = array();
public fu...
I am trying to separate behaviour from data completely in my classes and came up with this simple solution:
class ClassAData
{
public int Property1;
public string Property2;
public bool Property3;
}
class ClassA : SomeInterface
{
public ClassAData Data;
//behaviour
public int CalculateSomething(int value)
{...
Hi, I have sort of a philosophical question, which also need to consider the performance impact.
We are designing a new system with many sub-services that are not related to each other, yet, some may use each other (We are using unity to avoid any decoupling).
My main question is:
Should we break them into separate DLL's, where each ...
I need some pretty approach to load polymorhic object
I have base class and several derived classes that base is not aware of. The only thing
base class knows is Type enum wich defines which actual class it is.
class Order
{
OrderType Type;
bool Load(string filename)
{
// load Type
}
}
class LimitOrder : Order
{
// some data...
I have a few tables that reference the same table. For example:
Person has an address.
Business has an address.
When using the models I would like to do this in the controller:
person.Address.Zip
business.Address.Zip
I'm coming from a rails background where I can just declare a relationship and have all the above functionality. Forc...
Hi!
I'm making a game engine in C++. It is supposed to read all its game-level logic from XML files, so I'm in need of a simple, but rock solid way of creating and handling events. So far all i have done is to use an Action class. It's practically equivalent to throwing callbacks around.
An example could be an object (a map), that can ch...
Good people of SO,
Today I have some serious concerns on my business layer design.
It is based on Entity POCO objects and
I want to add logic to these entities BUT, there are 2 types of logic:
Pure C# logic
Persistence logic (LinqToEntities in my case)
My question is simple:
How should I separate these two kinds ?
First, I was thi...
Hi everyone,
I'm asking this question given my chosen development frameworks of JPA (Hibernate implementation of), Spring, and <insert MVC framework here - Struts 1, Struts 2, Spring MVC, Stripes...>.
I've been thinking a bit about relationships in my entity layer - for example I have an order entity that has many order lines. I've set...
Hey guys,
I often hear/read about interfaced based programming but I am not exactly clear on what that really means. Is interfaced based programming an actual stand alone topic that actually has books written about it? If so, can anyone recommend any good ones?
I came across interface based programming as I was reading about how good...
I have a backend that generates gift codes, each with a certain number of uses. Give these to a blogger or whatever, and their readership can redeem the code for a promotional item.
I'm working on the best way to check a codes validity without having collisions/dupes, or anything like that. I need to 1) validate the code 2) collect ship...
Hi,
I working on a MVP designed application and have some design questions.
When writing code in the presenter-layer how should the comunication go between different presenter/viwes?
Lets say I have a WindowPresenter with its WindowView and I want to set the window title on a window from another window. I have a title/set:er on the wind...
What is the difference between the terms factory, provider and service?
Just getting into nhibernate and its repository pattern (POCO classes, etc).
...
Here is a brief description of what I want to accomplish.
I am developing a peer to peer application using sockets. I want all my communication to be asynchronous. When ever a peer will ask another peer for something, it will send him the request tagged with a unique id. He will also store this information that what should he do with he...
I'm writing an application to receive SMS messages via an HTTP gateway. The main parameters I'll be processing are the sender's phone number and the message itself. However, depending on the keyword within the message, I'll need to execute different logic / return a different response. To start with, I used a simple if/else which turned ...
Hi,
My object Item has several binary states which can be combined
bool CanBeSold;
bool CanBeBought;
bool CanBeExchanged;
I need to store current combination of values into one variable. The reason
is that I need to store this value in DB. In C++ I would create a bit-mask
where one state occupies some bit. Is it good practice in .NE...
Title says it all. If it helps, the languages in question are java and c++.
...
In the Observer design pattern, the subject notifies all observers by calling the update() operation of each observer. One way of doing this is
void notify() {
for (observer: observers) {
observer.update(this);
}
}
But the problem here is each observer is updated in a sequence and update operation for an observer might no...
I have read the wikipedia definition of a domain model. I still don't get it. I have been reading alot of posts for NHibernate and almost in every post I read I see the term Domain Model. What exactly is it and does any one have an example of a domain model.
...