SJCNet is the home of architect/developer/techie, Simon Coope.

Tag: C#

Total 5 Posts

Composite Pattern

The composite pattern is a structural design pattern that's used when you want to compose objects into tree structures to represent part-whole hierarchies.

Basically, the composite pattern is useful when we want to treat individual objects and collections of objects in the same way. For example, to represent a hierarchy

Continue Reading

Structs and Lists

I had a bit of an interesting time with some very basic code today. I was iterating over a collection and updating properties of items in the collection. But when out of the loop the settings hadn't been maintained. So as an example, the code in question looked similar to

Continue Reading

Rounding in .NET

I was working through a Pluralsight course a few days ago, and came across a little snippet discussing how Math.Round actually performs it’s rounding calculation. As I was taught in school by default you round up. For example I would have thought that the following test would pass:

Continue Reading