1
vote
0answers
26 views

how to process document state transition?

Imagine there is an application (ASP.NET MVC) that processes some documents. The document must be revised several times by different group of users. state/role rules: simple user can only publish ...
1
vote
1answer
76 views

alternate approach of binary serialization/de-serialization

Is it possible to convert a list of object directly to byte[] (and vice versa) to gain performance (by avoiding serialization/de-serialization)? What I have in mind is that a list is somewhere in ...
0
votes
1answer
40 views

Modifying XML documents using deserialization/serialization VS LINQtoXML and XPATH [on hold]

I have XML documents that I need to modify, I also have the XSD schema that defines their structure. What I did was this using XSD.exe tool I create class object from the schema in program ...
1
vote
0answers
74 views

Are your code-first classes your domain classes? [closed]

When using Entity Framework does anyone else make a distinction between their code-first data classes (used to generate their DB) and their domain classes? If you don't, how do you reconcile the ...
0
votes
2answers
90 views

Testing C# Eventhandler Subscription

I want my unit tests to be able to verify that some events were subscribed or unsubscribed at specific points. Currently, I see two options. VerifiableEventHandler Each client subscribes using the ...
0
votes
1answer
169 views

The problem of dependencies management

Let's consider the next situation: We have a module A which has a class Crt570 intended to interact with a device. We have a module B which uses Crt570 in the class called M100Communicator. We have ...
0
votes
1answer
63 views

A specific problem with architecturing a part of our application

Firstly, I'll try to describe the real world model of what we are trying to express in C# code. We have a device called M100. It's purpose is to read\write data from\into cards (plastic or ULTRALIGHT ...
-3
votes
0answers
57 views

Very simple sending mail application - exceptions [closed]

I would send an email from my mail adress to other mail adress. I know that here is a lot of topic about it, but I really don't know where I have mistake. What I am doing: MailAddress from = new ...
0
votes
0answers
20 views

Executing user configuration settings

For an API I'm building what it does is load an XML file that is passed to it as a string, drill to the correct element, modify values, and return the modified XML. I'm doing something like this in ...
1
vote
2answers
152 views

Environment-aware Code

There are situations where the deployed environment (development, test, or production, for example) might dictate the outcome of certain actions. For example, perhaps a successful "user registration" ...
1
vote
1answer
172 views

Does the recent open sourcing of MSFT's C# compiler mean it can be made cross-platform? [closed]

I really enjoy working with C# however one of its biggest drawbacks is that it is kind of split-brained between MSFT .NET and Mono. In practice its not a big deal most of the time but it is one of ...
0
votes
1answer
93 views

Domain driven design and WCF services architecture

I am trying to figure out how to architecture my project in the DDD paradigm (a complete beginner in DDD) and stumbled upon a problem about the implementation of the web services... These are some ...
0
votes
1answer
87 views

log4net - roll my own singleton, use LogImpl, etC?

Reposting here... hopefully the better place to seek opinions on the matter. :) Writing my own log4net wrapper class using C#. I want to create a lib such that I can reference it from any ...
0
votes
1answer
103 views

When getting a list of files to process, should I store them to a list of string, or a list of Stream? [closed]

for a list of files, coming from a list like from a file dialog is it better to store the list as a list of strings or should I convert each file to opened Streams stored in a List? For example ...
2
votes
6answers
289 views

Design pattern for method to accept one of several static items in C#?

I want to illustrated my question by way of a (hopefully) representative example. Lets say I have a situation where I am developing a class library in C# to be used in some simulations. I want to ...
1
vote
1answer
76 views

What design pattern can I use to represent processing data from any stream?

I'm reading data from a stream in buffered series of bytes (say 1024 bytes at a time) and do some comparison, checking, or processing, before writing it back to the same type of stream. Currently ...
2
votes
5answers
260 views

Create Database To Fit Data vs Make Data Fit The Database

I'm newish to programming and would like to know what people have found to be the most supportable option or rather what people find more understandable. I'm the only one writing code at my firm, but ...
4
votes
1answer
92 views

Mobile/Global User Authentication? (Non-domain and non-enterprise)

What is the current way to authenticate users in a mobile/global fashion? In other words, assume a mobile application. And if there is a database server in the backend, how would these users ...
1
vote
1answer
169 views

Separate namespace just for exceptions?

I was doing a code review and came across something odd which I've never seen before. The developer decided to create a sub-namespace just to contain all the assembly's exceptions. I thought I had ...
1
vote
1answer
45 views

Design: Mixed XML / Relational or Pure Relational?

Is it acceptable to model a very complex object graph using XML in the database, but leave the rest of a system in relational tables? I'd like to gauge opinion on this as I've hit a bit of a ...
0
votes
3answers
139 views

Is the Adapter the correct design pattern for this situation?

I have an instance of a class UntouchableClass of which I need to access the member variables to use in my DotLiquid template. Problem is, UntouchableClass has to inherit from Drop if I want to use it ...
3
votes
1answer
169 views

Should Libraries Use Events or a Set Action

I'm building a small reusable library for two systems our company manages. Something that I've been caught up on is whether I should expose a set of properties of type Action<T> for events such ...
2
votes
4answers
315 views

Is it bad practice to update an object in a static method?

Still learning .net and OOP and have a basic question I hope. This is an asp.net mvc app. Looking at the code below, I am most concerned with the line in CheckShippingVendor that says ...
0
votes
2answers
138 views

How do I create single object that changes functionality based on programmer input?

I have several classes that all behave according to one interface. But in each class there are additional functions defined that give each class slightly different behavior. What I want to do is ...
2
votes
2answers
160 views

Pattern for multiple datasources

I've already read this question on CodeReview. I was hoping for general advice. I'm writing a service which will go to numerous data sources. Each source requires getting copious amounts of data ...
0
votes
1answer
144 views

What does the implementation of .NET string.Split(char[], StringSplitOptions) look like from inside?

That is if we were to see how Microsoft wrote this method what would it look like? I'm mainly interested in the use of the StringSplitOptions enumeration with the other parameter and how they probably ...
4
votes
3answers
496 views

Extension method naming convention [closed]

We are using some utility methods in our company to simplify programming. So we have following string extension: public static bool IsNoE(this string s) { return string.IsNullOrEmpty(s); } ...
0
votes
0answers
158 views

What are the shortcomings of using AuthorizeAttribute in this way in MVC?

I have ASP.Net MVC project code with custom authorization as below: public class UpdateAccrualAuthorize : AuthorizeAttribute { public override void OnAuthorization(AuthorizationContext ...
-1
votes
1answer
211 views

Better sticking with MDI or learning WPF? [closed]

I have a personal project I'm going to start working on soon. It will be database driven and have various screens that the operator may want to use. First thing I thought of was an MDI interface would ...
0
votes
2answers
103 views

How should I structure my namespace tree so that I have a Math class and Math namespace?

I don't know if this is a good or bad idea, or if it's technically even possible... but I'd like to have something of the following sort: public class Math { public int gcd(a,b) // Method for ...
0
votes
2answers
230 views

Model and ViewModel for View

I am new to the MVVM pattern. I have a window which has 3 text boxes (Name, Address, Description), a save button, and a listview which displays the above fields. When the save button is clicked I want ...
0
votes
1answer
155 views

ASP.NET C# and MVC - Step by Step [closed]

I am totally new and do not know where to start learning. I am exposed to the IT industry in a broad manner at work with no specific thing to learn about. I definitely want to work with c# and MVC to ...
1
vote
1answer
125 views

WHere do I put my update class and handle request / response from HTTP web request?

I don't know how to organize my code. Right now I just dumped everything in MainPage for testing. But what is the proper way to handle getting data from REST web service in Windows Phone 8? I have ...
2
votes
2answers
173 views

Should I lock a list of objects while a socket is receiving messages?

I have a scenario where I will be receiving messages through a socket connection. I also need to keep a list of 100 messages (such as List) and periodically toss out old messages from the list when a ...
3
votes
2answers
316 views

Why do we need to use sealed on a class? Do we really need sealed?

Reading this article (by Eric Lippert), it has four arguments as to why you should use sealed, however, I don't understand why we actually need it. Philosophical/aesthetic reasons aside, why do we ...
17
votes
1answer
851 views

Async network programming using Reactive Extensions

After doing some (more-or-less) "low-level" async socket programming years ago (in an Event-based Asynchronous Pattern (EAP) fashion) and recently moving "up" to a TcpListener (Asynchronous ...
1
vote
1answer
162 views

Invoking a web service in a Web API Project…in which layer to invoke?

I am using Microsoft ASP.NET Web API 2 and one of my end points has to internally invoke a legacy non-Microsoft web service (not asmx or svc) . Which layer should I invoke this in? I currently have ...
2
votes
1answer
151 views

Where do service implementations fit into the Microsoft Application Architecture guidelines?

The guidelines discuss the service layer with its service interfaces and data/message/fault contracts. They also discuss the business layer with its logic/workflow components and entities as well as ...
7
votes
4answers
342 views

What are good ways of balancing informative exceptions and clean code?

With our public SDK, we tend to want to give very informative messages about why an exception occurs. For example: if (interfaceInstance == null) { string errMsg = string.Format( ...
1
vote
2answers
640 views

How do I make multiple calls to a web service without taxing that service heavily? Scaling question

is there a good pattern for how to send multiple calls to a web service but without taxing it and ensuring the data is sent back? I don't know enough to correctly describe the problem to even start ...
0
votes
1answer
471 views

State design pattern: best implementation for my case?

Me and a mate have a discussion about what would be the best way to implement the pattern state for managing several screens for an application we are developing. We have a ScreenManager (I guess the ...
0
votes
2answers
433 views

I'm currently behind two NAT's with no public IP. Is there a way to self-host a client/server application? [closed]

I'm planning to write some small application for me & my friends. Specific functionality aside, it should allow me to "host" a session (using a dedicated server application) and my friends to join ...
1
vote
2answers
602 views

Data Transfer Best Practices

At my company we have some vendors that we transfer data to and from. Sometimes the data is pulled into our local SQL database for business reporting. Other times we pull data from one vendor, ...
-1
votes
1answer
2k views

WCF or ASMX WebService [closed]

I have been asked to create a web service that communicates with Auth.NET CIM and Shipsurance API. My web service will be used by multiple applications (one a desktop and another a web application). ...
1
vote
2answers
241 views

IL and case-sensitivity

Quoted from A Brief Introduction To IL code, CLR, CTS, CLS and JIT In .NET CLS stands for Common Language Specifications. It is a subset of CTS. CLS is a set of rules or guidelines which if ...
1
vote
1answer
376 views

Is ZeroMQ a good choice to make a Python app and a C# managed assembly work together?

I have a task that involves talking to a .NET-based API (namely AutoCAD) to retrieve data, send commands, and react to events. I want to separate the API operations and the proper program logic ...
1
vote
1answer
188 views

Task Consumer/Processor architecture

PROBLEM We have various tasks in our system which can take up to 20 minutes. These tasks are generally started from the web interface and run on a new thread. This is obviously a terrible solution ...
1
vote
2answers
438 views

Memory allocation of Classes that don't have any global data and locks

static void Main(string[] args) { var c2 = new Class2(); var c3 = new Class3(); var c1 = new Class1(c2, c3); c1.Method1(); } class Class1 { ...
3
votes
2answers
1k views

Well designed Open Source WPF Applications [closed]

I'm just wondering if anyone knows about some well designed .NET Open Source Applications using WPF? I have already tried to search at the usual sites like GitHub and Sourceforge, but I wasn't very ...
5
votes
2answers
642 views

I have to use Visual Studio 2005. What are good alternatives to using LINQ?

I have recently started a new job and am being forced to use VS 2005 and .NET 2. This has been quite painful for a number of reasons, but the one big change from VS 2005 to its successors was the ...