2
votes
1answer
77 views

will having an event with subscribers prevent an object from being GC'ed?

I have an object, which has an event which in turn has subscribers. I know that the subscribing objects won't get GC'ed since the delegate they stored for the event is connected to them, thus keeping ...
2
votes
1answer
112 views

Is there a way to use RAII techniques in COM?

I am caught between two conceptual models of how to construct objects, and am having trouble working out what standard I want to adopt. I prefer to program in .NET and often try to use RAII and ...
0
votes
1answer
67 views

Return tasks or expose events? [closed]

What is preferable when you program an API? And I have to add that in my case there will be two events exposed in spite of everything.
2
votes
1answer
81 views

If the UI layer depends on the Application layer. Who starts the application/process?

This is related to DDD for a desktop application in c#...with 4 layers ui/application/domain/infrastructure. Actually 3 desktop applications sharing part of the domain and part of the infrastructure. ...
0
votes
1answer
42 views

Organizing solution / project structure and classes for Line of Business Application (LOB)

The question how-do-you-organize-your-projects already has a few good answers. I would like to get a better understanding about this suggested structure: MyApp.Core MyApp.Model MyApp.Presenter ...
1
vote
2answers
90 views

Setting fields with correct default value

When writing constructors, I regularly encounter a situation where some fields already have approperiate (default) values, such as false for boolean values and 0 for integers. What are reasons to ...
0
votes
0answers
38 views

Can sequence alignment algorithms be used for search implementation?

Hi I want to implement a search on a website which includes imperfect search results. Meaning, if the search term is misspelled or slightly different from a 100% match, the function should still ...
0
votes
1answer
107 views

Coding shortcuts for type conversions or similar [closed]

bool? example = null; is actually Nullable<System.Boolean> example = null; Now for the bool to System.Boolean conversion or actually compile-time replacement: We ususally hardly care, as it ...
6
votes
2answers
164 views

Why does F# Core define generic array types?

I just noticed that the FSharp.Core namespace includes generic array types of up to 4 dimensions, i.e. Core.[]<'T>, Core.[,]<'T>, etc. C# and VB seem to be doing just fine with System.Array - ...
1
vote
2answers
162 views

When to use [Pure] on a constructor?

I'm learning about code contracts in .NET, and I'm trying to understand the idea of pure constructors. The code contracts documentation states: All methods that are called within a contract must ...
1
vote
1answer
140 views

Architecture of large-scale API (User Management)

We are currently designing an API that will hide different services (Product, Content, User etc) that will be used by our own website, our own apps etc. It is not a public API. We are looking into ...
2
votes
3answers
305 views

invoking methods within a conditional expression

In an oft-cited (if dated) reference for C# coding standards (pdf; from Lance Hunt), the statement is made, 33. Avoid invoking methods within a conditional expression. I've not seen this ...
3
votes
1answer
114 views

Showing a View from another View in MVP

This question is regarding MVP triads. Lets say I have two triads and first one has View1, Mode1 and Presenter1. Second triad has View2, Model2 and Presenter2. Now what I trying to do is, I just want ...
1
vote
1answer
41 views

Presenter accessing the value in text box using sender object

I have following method in my presenters which validates the user inputs on the UI. Basically to capture the value of the text property of the text box, it uses sender object which was passed in by ...
0
votes
0answers
41 views

UI Field validation in MVP pattern

I want to validate the details provided by the user before taking them into the processing. My UIs have Text boxes, Combos mainly and, there are some fields that user must provide a data, in some ...
0
votes
0answers
47 views

Using Statement lambda in exception handling

Following is a code snippet from MVP Win Forms application and this explanation would be helpful when answering the questions. My DAL doesn't handle exceptions and it will be propagated up to the ...
1
vote
1answer
63 views

Exception handling in WIn Forms application

When handling exceptions for example in a method in my presentation logic, is it ok to catch all possible exceptions in a one catch block as follows if the only purpose here is alerting the user. ...
1
vote
1answer
51 views

DAL Exception handling in a MVP application

In a MVP win forms application I'm handling exceptions as follows in DAL. Since the user messaging is not a responsibility of DAL, I want to move it in to my Presentation class. Could you show me a ...
1
vote
4answers
227 views

Circular dependency and object creation when attempting DDD

I have a domain where an Organization has People. Organization Entity public class Organization { private readonly List<Person> _people = new List<Person>(); public Person ...
1
vote
1answer
149 views

.NET Compiler Platform (Roslyn) , its relevance to developer community and its performance? [closed]

I'm just starting out with a Code-Quality-plugin development for my organization based on the recently released .NET Compiler Platform APIs (Roslyn APIs). I would like to know what are the most ...
-1
votes
4answers
287 views

Advice for beginner programmer [closed]

I am beginner in software development. I noticed when I try to learn one technology let's say .NET I lose my grip over other for example Java. I thought it would be better to concentrate on one ...
1
vote
0answers
44 views

Handling permissions in a MVP application

In a windows forms payroll application employing MVP pattern (for a small scale client) I'm planing user permission handling as follows (permission based) as basically its implementation should be ...
0
votes
1answer
126 views

Good approach for hundreds of comsumers and big files

I have several files (nearly 1GB each) with data. Data is a string line. I need to process each of these files with several hundreds of consumers. Each of these consumers does some processing that ...
0
votes
1answer
152 views

Why is String Templating Better Than String Concatenation from an Engineering Perspective?

I once read (I think it was in "Programming Pearls") that one should use templates instead of building the string through the use of concatenation. For example, consider the template below (using C# ...
-3
votes
1answer
71 views

Wrong encoding in DataReceivedEventArgs [closed]

I start cmd.exe process and redirect stdin to pass script to it and redirect stdout and stderr to read cmd's output. Here is the code of my DataReceivedEventHandler: (o, a) => { ...
2
votes
3answers
167 views

What is a good way to share internal helpers?

All my projects share the same base library that I have build up over quite some time. It contains utilities and static helper classes to assist them where .NET doesn't exactly offer what I want. ...
0
votes
2answers
131 views

Client auto-detect required server

I have a project that requires a client app to communicate with a server. I was wondering if there is a way for the client app to detect available servers and "know" by some method or another which ...
0
votes
0answers
127 views

Updating GUI in 'realtime' using events

My Plan Have a system that holds some objects Have a winforms-form that displays some key values of these objects When certain changes occur(object gets add / removed / datat change): Update GUI ...
0
votes
1answer
220 views

What language is better for working with databases? [closed]

I am going to develop a software that works with different databases and I'm considering whether to use .NET languages or C++. I've known that .NET features LINQ and ADO.NET but are there features ...
1
vote
1answer
199 views

entity framework 6 agnostic enough different sql server and OS platforms?

It's my first time using sql server, I usually go with MySQL, so I'm unsure how to do this. The project I'm assigned will be deployed to multiple platforms particularly PC's with different SQL server ...
0
votes
1answer
124 views

Project Organization

I have been having a discussion with a colleague about the best way to organize a (C#)project after he reorganized a project I had been working on from something that looked like this: To something ...
2
votes
2answers
189 views

As a .NET WPF developer what are key differences I should be aware of when working with ASP.NET MVC? [closed]

I'm a fairly experienced desktop .NET developer with a solid feel for MVVM and WPF, and I've worked with JavaScript, jQuery and HTML/CSS in the past - though I'm pretty dated and haven't had a ton of ...
5
votes
5answers
237 views

How to enforce implementation of interface to behave a certain way

Suppose you had the following interface public interface IUserRepository { User GetByID(int userID); } How would you enforce implementers of this interface to throw an exception if a user is ...
2
votes
1answer
127 views

Should classes that define settings and application configuration follow SOLID?

I'm just wondering if you have an application where you define a class that defines some user configurable settings (from an xml file, or a GUI), should you design it so that it follows SOLID as much ...
0
votes
1answer
165 views

Claim based authorization for application framework? [closed]

I am developing a framework that makes common data management tasks easier for a couple of future applications built on top of it, including document management, data versioning, retention, locking ...
1
vote
1answer
260 views

How to handle exception in REST API

Given a REST API, which throws an exception when handling a request from a client. Whenever the REST API throws an exception, it's logged and the application (in this case a console application) ...
-1
votes
1answer
70 views

Designing XML - confused between attributes and elements [closed]

I have to design an xml structure to set standard data exchange with my client. We deal with payments and its related data. At now, my XML data looks like this: <PAYMENTS> ...
1
vote
1answer
204 views

Why did Microsoft dropped the RESX model for RESW in Windows Store applications?

Why did Microsoft choose to change the resources management system from .NET's RESX files? RESX had useful code generation, providing developers auto-completion for resources names and outputting ...
2
votes
1answer
105 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
193 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 ...
1
vote
2answers
225 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
230 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
119 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 ...
0
votes
1answer
118 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
200 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
202 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
415 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
166 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
117 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
335 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 ...