Browse by Tags

All Tags » General Development (RSS)
When designing your applications to expose list-based data, there is a difference between styles of programming. For instance, suppose you wanted to expose a collection of objects to the consumer. This could be simply done using the following class: public...
Posted by bmains | with no comments
You may have noticed that I tend to shift subjects quite a bit. I talked about Agile a while ago, and have moved away from talking about it. I needed to grow and learn about the processes, which I have done a little. I'll always be a student in this...
Some people may not be familiar with the use of the new "var" keyword. The easiest way to explain it is: whatever your evaluation or return type of a method is, this is what the data type is. If you do: var values = CallSomeMethod(); //returns...
Posted by bmains | with no comments
Filed under:
Whenever it comes to determining whether a business object meets a certain state, I like to do create a property or method for this. For instance, evaluate the property below: public bool IsCompleted { get { return this.CompletedDate != null; } } The...
Posted by bmains | with no comments
One issue often overlooked is concurrency issues. I know in my development, I sometimes overlook this task. But concurrency issues are important, especially with some data access layers like LINQ-to-SQL. So how can this be prevented? You can use an approach...
Posted by bmains | with no comments
Filed under:
When using reflection, you may get an error back that doesn't seem to fit the mold of reflection; I was dynamically executing an object through reflection, and I got the error "object not set to an instance of an object". The class I was...
Posted by bmains | with no comments
Filed under:
I was developing today and got a StackOverflowException, and I quickly realized what it was. One of the ways you get this is if you do "too much" in the constructor; that is, you can do limited things in the constructor. If you get this from...
Posted by bmains | 1 comment(s)
Filed under:
Events have multiple purposes. Not only do they notify someone that someone occurred, but they can also be used to request information. This requires that the event argument that you are using has a writable property. For instance, suppose there was this...
Posted by bmains | 2 comment(s)
Filed under:
When ASP.NET 2.0 came out, it featured Table Adapters, which is the new way to replace typed datasets and connections. This approach is cleaner, but works in a very similar way to typed datasets. Furthermore, table adapters have a nice interface when...
Posted by bmains | with no comments
Filed under:
When using generics, and you get an error "Given Expression is Never of <X> Type", it is usually how it is assigned. For example, I was trying to do this: public IInterface<T> CreateProvider<T>() { if (typeof(T) is ObjectA...
Posted by bmains | with no comments