Level: Intermediate to Object Oriented Programming; Beginner + with .Net and C#
Design Patterns are a very useful programming concept that is often forgotten about in the heat of a programming project. Design Patterns are basically code design templates that have been perfected over the years by many different programmers and architects. They represent repetitive design concepts that don’t differ much.
One of the most famous design pattern books is called Design Patterns – Elements of Reusable Object Oriented Software by Erich Gamma, Richard helm, Ralph Johnson and John Vlissides. They are collectively known as the Gang of Four(GOF) and the book is commonly know as the GOF book. I highly recommend this book as you learn object oriented programming. It will start to make you think in patterns, which is essential to software. Every application follows some similar concepts and patterns.
Many ...
Read the rest of entry »
When: Tuesday February 21, 2006 - 6:00pm
Where: Map/Directions to the meeting at Greenville Technical College
Agenda:
6:00 PM Pizza and networking
6:30 PM Announcements
6:45 PM Presentation - Building Sharepoint Web Parts
8:15 PM Prize drawings
8:30 PM Wrap-up
Custom Sharepoint Web Part Development
Chris Rogers, Customer Effective
Chris Johnson, Thunder Hole Software
Arguably one of the hottest technologies to emerge from Microsoft over the past several years, Microsoft Office Sharepoint Services and Microsoft Office Sharepoint Portal Server enable large and small groups alike to collaborate in new and exciting ways.
Plan now to come to the February Enterprise Developer's Guild meeting where we will discuss how you can quickly and easily develop custom web parts that expose all sorts of data - legacy, XML, relational - in a clean, approachable portal environment. We'll cover all the items you will need to go back and develop your own web parts the very next ...
Read the rest of entry »
Introduction
Multithreading, a very powerful technique, is essential for modern software development. . Software users expect to work with a very responsive program that they don’t have to wait on, which is a very reasonable demand with the processor speeds that are currently available. Enter multithreading. Multithreading is the concept of having several different paths of code running at the same time.
When you introduce multithreading in your applications, you immediately make programming more complicated and add design time. You must know exactly what your application and all its threads are doing at all times. You have to account for deadlocks, race conditions and corrupting variable values. In this article we will examine the different methods in Visual Basic.Net to accomplish thread synchronization.  ...
Read the rest of entry »
In your Visual Basic.Net journey, you have definitely encountered a well used but little understood phenomenon called a delegate. You use them everyday, but might not know it. In this article, we will take a look at what a delegate is and how it will help you to develop better software.
A delegate can be defined as a type safe function pointer. It encapsulates the memory address of a function in your code. Whenever you create or use an event in code, you are using a delegate. When the event is thrown, the framework examines the delegate behind the event and then calls the function that the delegate points to. As we will see later, delegates can be combined to form groups of functions that can be called together.
Let’s first take a quick look at how to define and invoke a delegate.
First we declare our delegate in our form class:
Code:
Private Delegate Sub MyDelSub()
...
Read the rest of entry »
Dot Net has an interesting and very useful concept called Reflection. Since your compiled programs in Dot Net are compiled to IL and not machine code, it is very easy to query an EXE or DLL for what information it exposes in the form of classes, methods and properties, etc. In this article I will show you how to create a very simple and easy method for ”plug-in” type architectures.
Our project will consist of 2 DLL’s and one EXE. Our EXE will show a list box and fill it with any strings of information it finds in compatible classes. When you double click on the box, it will dynamically call the corresponding class that placed the string in the box. Our regular class will have one string and our plug-in class will have another, if the EXE finds the DLL in its directory.
As with all good architectures, we will start with an interface. The interface defined below will be the contract between our main EXE and any plug-in DLL’s that ...
Read the rest of entry »
Level: Intermediate to Object Oriented Programming; Beginner + with .NET and C#
The visitor design pattern is very useful in situations where normal polymorphism won’t work because we have fundamentally different objects, with different interfaces, that you want to work on your concrete main object. The pattern is used to give us a way to do these different operations on the object. According to the GOF book, you use the visitor pattern when:
1. An object structure contains many classes of objects with differing interfaces, and you want to perform operations on these objects that depend on their concrete classes.
2. Many distinct and unrelated operations need to be performed on objects in an object structore, and you want to avoid "polluting" their classes with these operations. Visitor lets you keep related operations together by defining them in one class. When the object structure is shared by ma ...
Read the rest of entry »
Level: Beginner + to Object Oriented Programming; Beginner + with .Net and C#
The command pattern is a very useful pattern when you want to give your users the ability to do certain things and undo them. Typical examples are the undo and redo on many programs today. This functionality is accomplished with the command pattern. The GOF book says to use a command pattern when:
1. Parameterize objects by an action to perform
2. Specify, queue, and execute requests at different times.
3. Support undo.[GOF235]
The pattern encapsulates the commands of your application in to self contained classes. For our example, we will revisit the dog example I have used before and play God for a while. Our operations will be to magically increase and decrease our bulldogs age. Since we are almighty, we of course, ...
Read the rest of entry »
Level: Beginner + to Object Oriented Programming; Beginner + with .Net and C#
The factory design pattern is very simple. Several other patterns build off of it though, so it is a common base pattern. You use this pattern when one or more of the following are true:
1. A class can’t anticipate the class of object it much create.
2. A class wants its subclasses to specify the objects it creates.
3. Classes delegate responsibility to one of several helper subclasses, and you want to localize the knowledge of which helper subclass is the delegate.[GOF]
The class is easy to implement and consists of an identifier, either named constants or an enum and a switch statement. For our example we will be creating dog objects. As with any good OO design we start with an interface for our related objects.
&nb ...
Read the rest of entry »
Level: Beginner + to Object Oriented Programming; Beginner + with .NET and C#
The Proxy design pattern shows a way to do just in time loading of objects that would consume too much memory to keep around, or takes a lot of time to load. This can be a very useful pattern for many applications. A good example of this pattern is in Microsoft Office. When you open a large Word document that has lots of embedded pictures, Office doesn’t load them all at the time you open the document. As you scroll down, Office will pull the pictures from the disk file and insert them into the document. You can see this by scrolling very fast down the document. It takes a second or so for the document to “catch up” to you and show the visible images.
For our example, we will have a part object that represents a manufacturers pa ...
Read the rest of entry »
Level: Intermediate + to Object Oriented Programming; Beginner + with .Net and C#
Frequently with applications many of the operations they perform are dynamic depending on several factors. Think about a common scenario, sales tax. Tax amounts are based off the place where you live. There are many different tax rates in each country. A good method of implementing dynamic patterns like taxes is needed. The strategy pattern covers this gap for us.
The strategy pattern is very useful when a dynamic formula or data is needed. In our situation it will allow us to swap out different tax objects when needed. The pattern lets a class take on many different behaviors depending on the context in which it is used.
The strategy patterns starts wit ...
Read the rest of entry »