I am Creating a new ASP.Net website "not mvc", and willing to make the data access layer has 2 versions, one using the Linq to Sql and another one using ad.net entity framework.
Note: kigg is doing the same but in MVC website and too complex than i want.
I learned that the best pattern to achieve my goal is using repository design patter...
I am not able to make a clear decision on this one.
I am OK by having numeric values on my tables and have the value information on the description of the column on the database for DBA.
But I also don't want to come to a point in future where having these numeric values on database creating too much headache for maintenance.
I'm not...
I've been reading about Singleton pattern for last few days. The general perception is that the scenarios where it is required are quite few (if not rare) probably because it has its own set of problems such as
In a garbage collection environment it can be an issue with regards to memory management.
In a multithreaded environment it ca...
Hi All,
I have to construct a simple viewer page of a model let us assume Person, where i present a set of criterias to the user to choose from(based on state of persisted models) for e.g i have a dropdown for departments showing all the distinct departments for which Person records are available and once departments are chosen , i wi...
Hello,
An enum structure declared in its own class is a member variable to the business logic class. That enum basically represents the state of that other class.
Although I have revisited the issue several times, replacing, or getting rid of those case statements proves quite frustrating to me.
Several business logic methods simple i...
Hi,
I need some advice on implementing UIs in WPF.
So far, I've been using Code-Behinds, which is extremely easy to get-started, but hell when maintaining/changing/testing.
I've looked at MVP (and its WPF variant - MVVM), but having some trouble getting started.
Assuming I have a UI to build, here's what I think I should do:
1.
Crea...
Hello,
The following enum structure performs certain operations while remaining agnostic to the client class (for encapsulation reasons)
public enum MyEnum implements Commands{
A{
public int method1(int varY) {
return varY+2;
}
public MyEnum method2(){
return MyEnum.B;
...
Hi,
I'm writing an application which will run as a daemon. UIs will connect to it over TCP. Now, there is a class called UiTcpInterface which will handle all communication between the UI and this daemon.
Now, I'm faced with the problem of ensuring there is only one instance of UiTcpInterface. What would be the best way to do it? Curren...
Hello,
I don't know if I am only like this or maybe some people has same problem. Always when I get a project I don't know how to design it well. I mean I just try to make UML design, but always it doesn't show the final result. In the end project has so many changes which aren't in the design, so my drawn UML gets useless to people who...
Hello,
I have been trying to figure out a way to tag several methods from my base class, so that a client class can call them by tag. The example code is:
public class Base {
public void method1(){
..change state of base class
}
public void method2(){
..change state of base class
}
public void m...
I think the easiest way to ask this question is with the actual real-world situation I'm facing.
In our system, we have a Site model (classic MVC framework here) that represents a row in our site table. One of the fields of the site table that is stored in the Site model is the time zone of the site. We use this to adjust UTC datetimes ...
I've started to construct a builder so that I can easily create test data for unit tests I am writing.
The basic structure of the builder is:
public class MyClassBuilder
{
public int id = 0; //setting the default value here
//allows MyClass to be built with a specific id
public MyClassBuilder WithId(int id)
{
t...
Hi,
I'm building an app, and I need the wisdom of the SO community on a design issue.
In my application, there needs to be EXACTLY one instance of the class UiConnectionList, UiReader and UiNotifier.
Now, I have figured two ways to do this:
Method 1:
Each file has a global instance of that class in the header file itself.
Method 2:...
What is the best way of initializing and terminating an application?
The library needs to be initialized/terminated only once and can be used by any number of dlls.
Is there any standard design to accomplish this?
This initialization has to be the very first step.
Is singleton is what I need here. Any number of dlls which are loaded...
I am developing an interpreter of a simple programming language.
There are tree-structured dynamic data, where each of the data nodes has an associated (owned) type-object.
There are several kinds of the types - ListType, StructType etc. - and one special - TypeRef. The TypeRef holds a name (a string) which refers to some concrete type...
Propose to consider the following problem.
Suppose we have some composite object.
Are there patterns that describe the solution of mutual notification of composite object parts, when states of these parts are changed
...
I'm trying to implement an identity map using generics. I have an abstract class, Entity, and a derivation constraint on my map for Entity. Since my map needs to be able to instantiate entities, my map also has a constructor constraint.
However, for the map to be useful, Entity subclasses should not be able to be instantiated from clien...
I've recently read about the boost::statechart library (finite state machines) and I loved the concept.
Does C# have a similar mechanism ? Or can it be implemented using a specific design pattern?
...
Architecture:
A bunch of clients send out messages to a server which is behind a VIP. Obviously this server poses an availability risk.
The client monitors a resource and the server is responsible to take action based on the what status the majority of the clients report to it and hence the need for only 1 server/leader.
I am thinking...
I am designing an app that will be using LINQ2SQL to persist the data in a database. I often use the Strategy pattern.
For instance, I may have a ClubMember object which can use different cost strategies like the following:
class ClubMember
{
public String name { get; set; }
public String email { get; set; }
private IMembe...