JavaScript: Functions

Please see my other JavaScript articles. Incorporating OOP into JavaScript for reusable logic. Though many programmers focus their OOP skills in C# while designing logic interfaces and classes, it’s just as important to do so when creating presentation-layer logic so that the code may be easily reusable. Below are examples of functions in JavaScript. This…

JavaScript: Classes

Please see my other JavaScript articles. Incorporating OOP into JavaScript for reusable logic. Though many programmers focus their OOP skills in C# while designing logic interfaces and classes, it’s just as important to do so when creating presentation-layer logic so that the code may be easily reusable. Below are examples of classes in JavaScript followed…

JavaScript: Changing a CSS class

Please see my other JavaScript articles. Using JavaScript to dynamically change a control’s CSS class. Using the DOM, JavaScript provides developers the options of dynamically modifying properties of HTML controls residing within the page. In this example, I will illustrate how to access a series of image buttons to change their CSS class in order…

Nested Repeaters

Please see my other C# articles. Achieving multi-level reporting. Many business scenarios require reporting data to accurately model the world from which it came. For example in a typical sales meeting, decision are made on several types of data. Therefore, such reports must reflect a multi-level structure in order to illustrate key metrics. In this example, I…

Design Patterns: Singleton

Please see my other Design Pattern articles. Ensuring single instance use during instantiation. Every so often in development, a business rule dictates that instantiation of a certain type produce only one instance during the lifetime of the application. The Singleton design pattern, one of the Creational Patterns, ensures that regardless of many instantiations of a…

Design Patterns: Service Locator

Please see my other Design Pattern articles. Completing the IoC Design Pattern. In my Design Patterns: Inversion of Control article, I illustrated how to decouple classes from having dependencies – the CustomerPayment class contained a dependency on the IPayment interface. Any class which has intimate knowledge of another is tightly-coupled to that class. By implementing…

Design Patterns: Inversion of Control

Please see my other Design Pattern articles. Providing flexibility into the domain by abstracting implementation. Using abstraction between concrete and class implementation, avoid tightly-coupled classes, which leads to changes in once class to ripple throughout your application. One method of doing this is the Inversion of Control design pattern which allows the class calling the…

Design Patterns: Factory

Please see my other Design Pattern articles. Providing flexible object-instantiation. In this example, I’ll illustrate a method by which a SalesAssociate object may be instantiated that is more flexible than the traditional way – using a constructor. Instead I’ll implement a factory design pattern to create the instance. There are two advantages to this approach:…

Design Patterns: Adapter

Please see my other Design Pattern articles. Exposing class behavior from another class. Sometimes you might need to access and use functionality defined from one class from within your own class. To illustrate this pattern, I’ll begin with a simple class that contains one method I wish to invoke from within my other class –…

C#: String Operations

Please see my other C# articles. Performing common string operations. The .NET Framework is essential a huge repository of reusable classes that provide robust functionality organized by various namespaces. For example, the String namespace allows developers to easily and safely manipulate strings in a variety of ways. First, I’ll show I perform such basic string operations using…