C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform

learn more… | top users | synonyms

0
votes
1answer
87 views

ASP.net performance code behind vs app_code

I am wondering about performance of a web site/application when there is code in the code behind files rather than when the code is moved to separate files in the App_Code folder. My understanding ...
1
vote
2answers
112 views

Testing ASP.NET .aspx and .ascx code behind files

I am wondering how to test .aspx.cs and .ascx.cs code behind. Can I use unit testing and if so how? Are there alternatives that will help test the functions in the code behind files? I don't know how ...
1
vote
1answer
132 views

How to get back into software development when you took a 10yr break? [duplicate]

I graduated 2004 CECS and the only experienced I had was at intern for 2 years. At that time I had c and c++ knowledge. I took a 10yrs break and now want to go back into it. I am interested in c#. ...
0
votes
1answer
90 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
2answers
64 views

Container/Item pattern without `friend`

I have a class Container containing objects of type Item. They are different classes, and especially they have no common base class (e.g. a Container does not itself have a Container).: class ...
1
vote
0answers
99 views

How much segregation is too much in this design?

We are working on ASP.NET webforms application developed using WCSF (MVP pattern). In the application, there is a search screen that allows the user to enter some fields and display the results. We ...
-3
votes
1answer
38 views

Text field Form [closed]

I have 2 forms that have text input fields. One is written in JavaScript and the other in ASP NET. I would like to prevent a single symbol, the dollar or string "$" symbol from being entered into the ...
-1
votes
1answer
89 views

RESTful API Call Method Names, C# [closed]

I am working on some old code that works with a REST api in c#. The method names (what method to invoke on the API side) is being passed in as hard-coded strings. Would a static class be the best ...
1
vote
2answers
59 views

Segregating interfaces/concerns to a tree [duplicate]

When working with a single object there are a number of ways to segregate interfaces to it. Breaking it into smaller components that can be treated independently. Breaking it into simpler ...
3
votes
0answers
125 views

How to modify ELO algorithm when number of games is low to reduce outliers

I've developed the standard ELO implementation that can be found here, but the problem I'm running into is that my players will only have between 10 and 40 games in a "season". Since my first season ...
0
votes
0answers
43 views

How to design modular “screen configurator” for database application

I am currently working with a product that is effectively a glorified CRUD application. (It is a C# .NET 4.0 desktop application backed by an Oracle 11gR2 database.) The client program presents a list ...
0
votes
4answers
206 views

How to handle or prevent all Admins and users being removed

I have a website that stores all users in a database. A user can log on to the website and if they have sufficient privileges can add/delete users, as well as change their privileges. How do I ensure ...
2
votes
2answers
145 views

When to use custom collections?

I see a lot of APIs that use custom collections instead of just using strongly-typed packaged generics. For instance, the API will have a Object1Collection instead of just a List<Object1> (or ...
0
votes
2answers
244 views

how are virtual methods slower in C#

I was reading the that virtual calls make the code slower than calling non-virtual call in C#. However the IL instruction for both are the same callvirt except in cases where base.somemethod() is ...
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 ...
1
vote
0answers
57 views

Guideline for managed (C#) and native code (C++) hybrid development [closed]

Is there any guideline for a mixed managed and unmanaged system architecture? Given the same amount of time I find managed code to give better performance. The default to pass by (constant) ...
1
vote
0answers
213 views

Reference type in struct in C# [migrated]

I was going through type values in C# and learned that they don't get allocated on the heap as normal reference types do. How does a struct with reference type get allocated? e.g. struct ...
1
vote
5answers
358 views

Unit Testing a method that contains two output type parameters

I was following a book Art of Unit Testing, This book says that You must not have any logic in Your asserts as this reduces readability of test, or I may be testing too many things at a time. Suppose ...
1
vote
0answers
69 views

State Pattern Code for embedded device - Dependency Injection of Device Objects in Context and State Classes

I'm wrestling with some code and I think I've finally gotten some state pattern code working with my events. I've got a simplified system that will work like this: This is my first go with State ...
1
vote
1answer
147 views

Designing software functions which are both pausable and restartable

Consider the following situation: One hardware device, two applications (1 C# application, 1 Firmware). The C# application sends frames to the firmware and the firmware executes scripts. C# -> ...
1
vote
0answers
71 views

Converting number based data to text based story [closed]

I'm looking for a model/strategy to use for converting data in the form of numbers into a text based story. The ultimate goal would be if the resulting story feels human written and that it is pseudo ...
-1
votes
1answer
70 views

ASP.net/IIS runtime envitonment [closed]

I'm not too experienced in the regard of configuring IIS/ASP.net. A client has asked me to extend the functionality of a custom web application I didn't develop. Unfortunately, they don't have the ...
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 ...
4
votes
1answer
285 views

Should reflection be part of design?

I'm currently designing a somewhat large program that will involve the simulation of math/physics models and collection of data (I have not implemented any code yet). One of the main problems I'm ...
2
votes
6answers
287 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
0answers
46 views

Run a function when a function in a list is executed?

Goal: I'm currently doing an MVC project and I have this method to update the ViewBag (based on previous actions of the user). I would like to call this function whenever a certain list of MVC Actions ...
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 ...
0
votes
2answers
72 views

Best practice to return a long string in a stub

I have some methods im trying to test which use a StreamReader dependency that i mock using Rhino mocks. But it is a large xmlFile. In the spirit of unit testing im trying to keep away from using a ...
0
votes
3answers
440 views

How can I explain this is an anti-pattern? [closed]

I recently started at a new job. The existing system works OK but is poorly designed and hard to maintain, and they are planning to rebuild it in MVC and I fear it will be much worse. (Not because ...
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 ...
13
votes
5answers
844 views

Why isn't java used as a build language?

If Java is a general purpose language, and building a program is something that can be described using the Java language, why isn't this the best way to write build files and instead we use tools like ...
1
vote
1answer
84 views

Software trial: limited time or limited functionality? [closed]

I am currently developing my first serious piece of software in C#. It is a good learning experience so far. My software is basically a task scheduling tool with some advanced features and ...
6
votes
4answers
1k views

Reason for (post/pre) increment operator in Java or C#

Recently, I've stumbled across question about predicting the output of code which heavily uses post/pre increment operators on integers. I am experienced C programmer, so I felt like at home, but ...
0
votes
0answers
32 views

Logging without Code Bloat [migrated]

I was wondering if any of you new any best practises or design patterns so that I can have good logging in my programs without them looking messy or bloated. I am currently using C# and NLog however ...
2
votes
2answers
234 views

Implementing the Interface Segregation Principle

Does this IConvertible interface satisfy the Interface Segregation Principle (ie. the "I" in SOLID)? Here is the definition: public interface IConvertible { TypeCode GetTypeCode(); bool ...
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 ...
2
votes
2answers
237 views

Should I expose a “computed” value as a property or a method?

I have a C# class that represents a content type in a web content management system. We have a field that allows a web content editor to enter an HTML template for how the object is displayed. It ...
0
votes
3answers
94 views

suggest structure for classes that maps to json with dynamic data without using dynamic or object reference

this is a kind of data i have to de-serialize { "id": "M:11427", "title": "DAX30", "nextStartId": "S:727831", "sections": [ { "type": "HIGHLIGHTS", ...
2
votes
2answers
24 views

How to invoke a method in a class always when the class is accessed - like a reaction? [duplicate]

I am working on a C# net micro framework project, in particular an I2C bus class. I have several different I2C devices each defined in separate classes which contain all of the devices' unique ...
1
vote
2answers
59 views

Logging page/session ID in an inner module

We have a C# ORM module that generates queries. It logs generated queries and other information into the error/trace file. It is used by our web application. Most of our queries are generated ...
3
votes
1answer
45 views

Where should CMS data logic go

We have a large web site written in WebForms and have begun implementing some new modules in MVC. We have a custom CMS in place. I put the data structure to hold CMS data in a BaseModel class. Now I`m ...
0
votes
2answers
149 views

Thoughts and Best Practices on Static Classes and Members [closed]

I am very curious as to thoughts and industry best practices regarding static members, or entire static classes. Are there any downsides to this, or does it participate in any anti-patterns? I see ...
0
votes
2answers
140 views

Data structures VS Classes and what happens if they merge? [closed]

Alright so I've learned this: Classes have public methods that perform operations on the class's data and they hide away their implementations. Data structures on the other hand, completely expose ...
1
vote
1answer
80 views

When internationalizing texts, should underscores (for keyboard shortcuts) be part of the texts to be translated?

I have a project where I need to translate a lot of words and text fragments in different languages. In these texts, underscores are currently added in these text (fragment(s)) to be used as keyboard ...
0
votes
1answer
190 views

Beginning Data Mining

For simplicity, my database has entities and transactions. Each transaction has a DateCreated and a foreign key to the entity. I'd like to have the ability to find entities that have had a recurring ...
1
vote
1answer
168 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 ...
0
votes
2answers
304 views

Web API architecture design

I'm learning and diving into Web API. I've used web services before but not specifically with web API. Below is how I am designing it so far and I was curious on the feedback. I have a ...
3
votes
2answers
336 views

Asterisks in Multi-line comments

Using Visual Studio 2012 with C#, when I write multi-line comments, VS automatically begins each line with an asterisk, like this: /* * * */ I was just curious if this was the case in ...
1
vote
3answers
424 views

Should utility base classes be avoided

Knowing that C# doesn't support multiple inheritance, is it considered bad form to write a utility base class? Some initial thoughts: I could create an interface and a concretion, but then the ...
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 ...