Learn IT

Free learning anything to everything in Information Technology.

Send a Message to Everyone Logged into a SQL Server

If you've done any heavy lifting in Database programming, you quickly notice that languages like T-SQL and PL/SQL can do quite a bit for you. While SQL certainly is powerful, it doesn't have many constructs that are a given in more modern programming languages. Additionally, cursors can do a lot for you, but they aren't fast and ADO.NET doesn't play really well with them.

Anyway, in this snippet, I'm going to use a While Loop in T-SQL, dynamically create some SQL commands, and fire them off via xp_cmdshell. Think about it for a second, if you did this some other way, it would take a good amount of work to fire off Net Send Messages to everyone logged into your database (and would be next to impossible with a non Client/Server database like Access). Well, this is pretty straightforward, you just query SYSPROCESSES, construct a SQL Statement, execute it, then requery SYSPROCESSES.

Check out the snippet below:

CREATE PROC usp_notify_users @notification VARCHAR(100)
AS

BEGIN
SET NOCOUNT ON

DECLARE @Command VARCHAR(300)
DECLARE @hostname SYSNAME

SELECT @hostname= MIN(RTRIM(hostname)) FROM master.dbo.sysprocesses
(NOLOCK) WHERE hostname <> ''

WHILE @hostname is not null
BEGIN
SET @Command='exec master.dbo.xp_cmdshell "net send ' + RTRIM(@hostname) + ' ' + RTRIM(@notification) + ' "'
EXEC (@Command)

SELECT @hostname= MIN(RTRIM(hostname)) FROM master.dbo.sysprocesses (NOLOCK) WHERE hostname <> '' and hostname > @hostname

END

SET NOCOUNT OFF
END


This proc takes in a Param @Notification which is what you want to broadcast to everyone. We declare another variable, @Command which is going to be used so we can dynamically build a T-SQL Statement and fire a command via xp_cmdshell.. Then we reset the values each pass through a while loop and NET SEND a message each pass through.

Five Secrets Of Successful Requirement Gathering

Introduction

Although most companies do some form of requirements, there is often a lack of understanding as to exactly why the requirements need to be created and the level of detail that should be included in the requirements.

Software is always created to solve a need for a client. The client may be an internal client, an external client, or even the general public. Detailed requirements are important to ensure that a program correctly and fully addresses client's needs.

Detailed requirements make initial development easier and faster because the developers know exactly what should be developed and do not need to make their best guess at the functionality to be implemented or delay development by creating requirements during development. Giving the developers accurate requirements will also result in less rework at the end of development because the stakeholder's requirements will have been implemented correctly initially and will not be arrived at through trial and error.

A project manager can use the detailed requirements to create accurate timelines and give correct estimates to the client. This ensures that stakeholders are completely aware how long development will take so they can adjust the scope of a project or proactively add resources if necessary.

Finally, testers can use the requirements to create test plans while development is ongoing rather than waiting until development is complete. The requirements give them information about what the program will do so there cannot be disputes between developers and testers as to what the program functionality should be. High quality requirements also describe problem paths that may need additional testing.

Even though highly detailed requirements make development easier in future phases, this is not always possible due to time constraints imposed by the client or market conditions. With this in mind, let's look at some secrets to improve your requirements process even under tight deadlines.

Secret #1: Include Use Cases

Use cases look at the requirements from the standpoint of an end user working with the program and how the program responds to the user's inputs. At its simplest level, a use case can be thought of as a play where the end user is one actor and the program is another actor. These two actors then have dialogs which explain the interactions between the actors. More complicated scenarios can have additional actors including other programs, other types of users, and even hardware. Use cases have proven to be very easy to read and understand even for non-technical clients.

Each use case explores what happens when something goes wrong in addition to the "normal" interactions. The exploration of these failure conditions is very important because these cases are the most difficult to code and can cause the most amount of testing. Traditional requirements often ignore these cases. It can be helpful to have developers and testers both think of additional possible failures in a use case so they can be fully documented in the requirements.

Use cases do not provide a complete picture of the system though. A technical specification should also be included in the requirements to detail formulas and routines that take place behind the scenes.

Secret #2: Prototype Screens with a Design Tool

A user of the program only interacts with a program through the user interface so it makes sense to spend a significant amount of time during requirements to ensure that the user interface makes sense, that all functionality is included, and that the most commonly used functionality is easily accessible. The easiest way of doing this is using a screen prototype. There are a variety of methods of making screen prototypes which range from simply drawing the interface with a pen and paper to building "working" prototypes in a higher level language like Visual Basic which allows rapid screen design. However, each of these extremes has serious drawbacks. A pen and paper prototype does not allow users to interact with the prototype and it is more difficult to change. A "working" prototype done in a programming language like Visual Basic can lead the client to believe that the program is nearly complete and that development should not take very long or it can lead the client to believe that changes to the prototype will be costly making them reluctant to make necessary suggestions to improve the program.

Between these two extremes lies screen design applications which allow you to draw the screens and model interactions between screens. High quality prototyping tools allow you to enter sample data and allow users to move between screens by pressing buttons so they can easily understand the interface and its functionality. Most prototyping tools produce the final output in an HTML format so they can be easily shared even if a client is not in the same office where requirements are being developed.

When looking for a prototyping tool, make sure to select a tool which is easy enough to use that you can easily prototype screens while your customer is in the room. This will allow you to brainstorm and make changes to the screens without delays. A prototyping tool should already have common controls already defined to maintain design standards and improve the appearance of your screens. Being able to enter sample data in each screen can allow the customer to pinpoint areas that may be incorrect.

Secret #3: Work Directly with End Users

When designing a new application or making revisions to an existing application, there is no substitute for the direct experience that end users have. An end user can give immediate feedback on your design to point out awkward or incorrect functionality. They also help to ensure that all controls are logically placed for the most efficient use of the system.

Using an interactive prototyping tool allows you to walk a user through the interface or even allow them to work directly with the prototype so they can quickly suggest improvements. As use cases are being developed, it is a good idea to walk users through the use case to ensure that the use case is well thought out and that all functionality is captured both in the use case and the prototype.

Secret #4: Do Iterative Requirements Development

When you create requirements, it is important to develop the requirements in multiple stages. For example, you may want to do a general layout of the program and create higher level use cases in the first session to get a feel for the overall requirements. In the next session(s), you can focus on each key feature to ensure that the normal paths are all defined in the use cases and further refine the prototypes. In the next session(s), you can attempt to define all of the error conditions which can occur and update the prototypes as necessary. The final sessions should review all work previously done to ensure that all requirements are clear and complete. At each stage, you should not be afraid to revise work done in a previous step because getting the requirements correct will ultimately save time in the more costly development and testing stages.

Secret #5: Place Requirements Documents under Change Control

With all of the time spent on generating clear requirements, it is very important to make sure that all of the requirements documents are included in your change control system. This includes use cases, screen prototypes, technical specifications, and any other documents used to define the requirements.

Conclusion In this article, we have explored various secrets to make your requirements process successful and ensure that your clients are satisfied with the resulting program even under tight deadlines. At the start of your next project, make sure you have the proper tools in place for a successful requirements iterations including a prototyping program, a tool to write use cases, and a version control program. These tools do not have to be expensive, and they will help to get your requirements right and schedule under control.

Overview: Test Driven Development

There are many benefits of test driven development including better end product with well defined supporting unit tests and having a programming paradigm that is a bit more flexible in regards to scope changes. Having unit tests available will make our code more maintainable over the long run is invaluable because we can modify our code without fear such as when we are adding/modifying functionality or refactoring. It could even be considered crucial when we have projects where the scope is likely to change throughout the development lifecycle like in the case where the functional specifications are not clearly defined before we begin producing code.

Test driven development can be a huge shift in the development approach for many of us. The test driven approach basically chips away at the solution like a sculptor would at a marble block instead of trying to define and create a monolithic application in one shot.

As a first step, we'll define the interfaces out software will adhere to. The interface should clearly define how our class is to interact with other classes and what information it will expose. This is a crucial step in any software design process because we really have to know where we are going and the interface serves as a map that will help us get there.

After we have an interface, we'll begin with the test-driven development cycle.
  1. Add a test
  2. Run all tests and watch the new one fail (and the rest succeed)
  3. Modify our code to make the test succeed
  4. Run all tests and watch them succeed
  5. Refactor, if necessary
  6. Run tests to ensure everything still works
  7. Repeat

Understanding MOSS 2007

The core target of Microsoft Office SharePoint Server (MOSS 2007) is to aggregate disparate (Different but separate applications) information, events, processes and enterprise services into a unified single view without to open multiple applications and cut and paste information across multiple screens.

In MOSS 2007 these composite applications are based on the concept of a service-oriented architecture (SOA). MOSS 2007 framework helps you develop components as distributed, reusable business services. MOSS 2007 split into small applications in small pieces.
MOSS 2007 is basically superstructure who represents the high-level integration of users, one-stop shop form information, managing interactions between people, and line-of-business (LOB) data within organization and cross enterprises. MOSS 2007 based on SOA framework that is driven by standard XML/ Web services.

It provides a window that connects people, processes, and information to create a unique & rich end user experience. For example, during a natural disaster, it can provide critical information to coordinate a response effort, monitoring traffic patterns, delivering supplies, dispatching resources, and aggregating information to present operational insight. In a manufacturing setting, you might use it to monitor inventory levels and assembly processes up and down a supply chain. It's an excellent aggregation point for all of these types of situations.

MOSS 2007 is point of collaboration & contents sharing. For example, SharePoint Portal includes workspace to help loan officers find, organize, and share information so they can process loans more efficiently. These workspaces used to be very limited in their reach, which resulted in a proliferation of mediums to support discrete processes. A mortgage broker might use a file system to store documents, e-mail to deliver loan applications to customers, a Web site to gather additional customer information, and a spreadsheet to monitor the loan approval process.

MOSS 2007 can unify all these tasks and offer collaboration tools to streamline the loan approval workflow. Loan officers will then have a single place to access and modify documents, check documents in and out of a repository, and work collaboratively to process loans, all without having to use multiple interface mechanisms.

So, MOSS 2007 become more process-centric, they serve as clearinghouses for managing multiple activities in multiple manners.

How To: Generate unique strings and numbers in C#

The System.Guid is used whenever we need to generate a unique key, but it is very long. That's in many cases not an issue, but in a web scenario where it is part of the URL we need to use its string representation which is 36 characters long. It clutters up the URL and is just basically ugly.

It is not possible to shorten it without loosing some of the uniqueness of the GUID, but we can come a long way if we can accept a 16 character string instead.

We can change the standard GUID string representation:

21726045-e8f7-4b09-abd8-4bcc926e9e28

Into a shorter string:

3c4ebc5f5f2c4edc

The following method creates the shorter string and it is actually very unique. An iteration of 10 million didn.t create a duplicate.
It uses the uniqueness of a GUID to create the string.

private string GenerateId()
{
long i = 1;
foreach (byte b in Guid.NewGuid().ToByteArray())
{
i *= ((int)b + 1);
}
return string.Format("{0:x}", i - DateTime.Now.Ticks);
}


If you instead want numbers instead of a string, you can do that to but then you need to go up to 19 characters.

The following method converts a GUID to an Int64.

private long GenerateId()
{
byte[] buffer = Guid.NewGuid().ToByteArray();
return BitConverter.ToInt64(buffer, 0);
}


The standard GUID is still the best way to ensure the uniqueness even though it isn't 100% unique.

The benefits of Office PerformancePoint Server 2007

Office PerformancePoint Server 2007 greatly improves visibility into company performance and the factors that are driving it. Office PerformancePoint Server 2007 also enables employees to monitor and act on performance variances.
Office PerformancePoint Server 2007 offers:
  • Robust monitoring and analytics capabilities. Office PerformancePoint Server 2007 monitoring and analytics capabilities enable business users to see and understand performance issues quickly so they can make better decisions faster—all without the need for technical assistance. The fact that scorecards, dashboards, and analytics are all integrated into the same application makes deployment simple and helps drive alignment and accountability. Office PerformancePoint Server 2007 helps individuals to be more effective and the organization to be more agile.

  • Improved planning, budgeting, and forecasting. Drive strategic objectives and goals into the planning and budgeting process to ensure departmental plans align with corporate strategy. Reduce the time and effort required through centralized control and administration and workflow that manages the creation and submission.

  • Faster financial reporting and consolidation. Consolidate financial data from multiple general ledgers and reporting systems to achieve a single, integrated view of financial information. Robust integration and administration of financial information helps increase information accuracy and reduce the time and effort required for statutory and management reporting.

  • Extends Existing IT Investments. Office PerformancePoint Server 2007 utilizes widely used and supported Microsoft technologies such as Windows Server, SQL Server, and Microsoft Office SharePoint Portal Server. This utilization enables companies to extend their existing investments and IT skill sets in these mission-critical enterprise technologies.

Features: Office PerformancePoint Server 2007

Office PerformancePoint Server 2007 features robust performance management capabilities including:
  • An integrated application for performance management. Office PerformancePoint Server 2007 provides all of the functionality that is needed for performance management in a single, integrated application including scorecards, dashboards, management reporting, analytics, planning, budgeting, forecasting, and consolidation. With Office PerformancePoint Server 2007, users can better understand variances between plan and actual, quickly analyze root-causes, and recast plans when necessary. Customers can enter the performance management process at any point, benefiting from a common data model shared across monitoring, analytical, and planning activities.

  • Business users shape their plans the way they think about their business. Office PerformancePoint Server 2007 provides business users with the ability to define, modify, and maintain their plans easily. The application handles the sophistication of the company business processes (rules, logic, calculations, and workflows) while helping more users contribute to the performance management process.

  • Flexibility to handle complex environments. Office PerformancePoint Server 2007 uses a model-driven approach to make it easier to create corporate models for scorecards, analytics, and plans that can also be used for departmental-level performance management. By providing synchronized models up and down the organization as well as across departments, users can more easily get a consistent view of organizational performance.

  • Reducing complexity for IT and for the business. Office PerformancePoint Server 2007 enables businesses to broadly deliver performance management across the organization by rapidly bringing together the power of Microsoft Office and the performance, scalability, and security of SQL Server. Office PerformancePoint Server 2007 is easy to use and less costly to deploy than traditional solutions. Office PerformancePoint Server 2007 also helps IT better support corporate governance through the ability the audit the performance management process as well as control versions and report on the processes.

Overview: Microsoft Office PerformancePoint Server 2007

Microsoft Performance Management allows customers to monitor, analyze, and plan their business as well as drive alignment, accountability, and actionable insight across the entire organization.

With Office PerformancePoint Server 2007 server:

  • Business executives can drive accountability and alignment across and up-and-down the organization.
  • Information workers can monitor, analyze, and plan activities with an integrated and collaborative solution.
  • IT managers can drive better adoption and compliance by enabling organizations to better associate business intelligence and corporate performance.

Office PerformancePoint Server 2007 provides all of the functionality that is needed for performance management including scorecards, dashboards, management reporting, analytics, planning, budgeting, forecasting, and consolidation. The application reaches all employees, across all business functions (finance, operations, marketing, sales, and human resources).

Decisions makers need to drive performance by accelerating business decision making, while adapting to changing business conditions and enforcing corporate governance. Office PerformancePoint Server 2007 allows the organization to build reliable plans faster and execute against them by aligning and driving accountability across business operations.

Abstract Class Vs Interface

Interfaces:
  1. Interfaces doesn’t have constructors
  2. Can implement multiple inheritances.
  3. Contain only abstract methods (Only method prototype is declared)
  4. Can not create object for interfaces.
  5. Interfaces are reference type.
  6. An interface can implement by multiple classes.
  7. A derived class can implement multiple interfaces, but can inherit from only one class (abstract or not).
  8. Interfaces are default public.

Abstract Class:

  1. Abstract classes can have constructors.
  2. Can’t implement multiple inheritances.
  3. Contain abstract methods and general methods also.
  4. Can not create object for abstract class.
  5. Abstract classes are reference type.

Garbage Collection in C#

Introduction

All the garbage collection mechanisms have one thing in common, that is they take the responsibility of tracking memory usage.

Understanding Garbage Collection in C#

The .NET garbage collector is optimized for the following assumptions
  1. Objects that were recently allocated are most likely to be freed.
  2. Objects that have lived the longest are least likely to be become free.
  3. Objects allocated together are often used together.

The .NET garbage collector is known as generational garbage collector. The objects allocated are categorized into three generations. Most recently allocated objects are placed in Generation 0.

Objects in Generation 0, that survive a garbage collection pass are moved to Generation 1.

Generation 2 contains long-lived objects, that survive after the two collection passes.

A garbage collection pass for Generation 0 is the most common type of collection. Generation 1 collection pass is performed if Generation 0 collection pass is not sufficient to reclaim memory.

Atlast, Generation 2 collection pass is peformed if collection pass on Generation 0 and 1 are not sufficient to reclaim memory. If no memory is available, after all the collection passes, an OutOfMemoryException is thrown.

Finalizers

A class could expose a finalizer, which executes when the object is destroyed. In C#, the finalizer is a protected method as shown below.

protected void Finalize()

{

base.Finalize(); // clean external resources

}

The method Finalize(), is only called by the .NET framework.

C#, will generate a code to a well formed Finalizer, if we declare a destructor as shown
~class1

{

// Clean external resources.

}

Declaring a Finalize method and destructor in a class, will lead to an error.

Dispose

Instead of declaring a Finalizer, exposing a Dispose method is considered as good.

If we clean up a object, using Dispose or Close method, we should indicate to the runtime that the object is no longer needed finalization, by calling GC.SuppressFinalize() as shown below:

public void Dispose()

{

// all clean up source code here..

GC.SuppressFinalize(this);

}

If we are creating and using objects that have Dispose or Close methods, we should call these methods when we’ve finished using these objects. It is advisable to place these calls in a finally clause, which guarantees that the objects are properly handled even if an exception is thrown.

Summary

The System.GC class provides methods that control the system garbage collector. We have to use methods from this class in our application with extreme caution.

Microsoft .Net Assemblies

Introduction
  • Assembly is a small unit of Code for Deployment
  • The basic building block for Dot Net Framework is an Assembly
  • Assembly can be an exe or dll file
  • But the difference between dll and exe is exe is an executable file
  • Dll is a reusable component.
  • Exe is a Stand alone application that can run on its own
  • Dll is used in other applications
  • Assembly is Collection of Data Types, Namespaces and Resources Information
  • Namespace is a logical design-time naming convenience, whereas an assembly establishes the name scope for types at run time.

The Four Main Parts

The main Parts of the Assembly are

  1. Manifest
  2. Type Meta Data
  3. MSIL Code
  4. Resources

Manifest

It will describe the assembly it will contain all the files information required for the assembly. These files includes all the other assemblies required for the application. It will be prepared by the complier by providing set of built in libraries and custom libraries provided with reference. This is required for the runtime to load the files at the time of execution Public key with Version number are stored here.

Meta Data

It will provide information about all the user defined types available with assembly

  • Includes
  • Namespace name
  • Class names
  • Interface names
  • Method names

This Meta data is required for the user of the assembly to access methods and classes.

IL Code

The source code in Dotnet is Compiled into IL code with the help of JIT complier in CLR .This code is responsible for Language independency, Architecture independency, Plat form independency and Security.
VS Command Prompt c :\> ildasm app.exe
File-->new-->open any dll from your existing web application
Double Click on manifest to examine manifest
You will find public key token with version number that is generated for Assembly
The expanded tree view of name spaces and classes methods is called Meta data
Try to examine Meta data MSIL/IL code that is generated for each method
MSIL IL code is in Assembly language it ‘s understands by only JIT Complier with the help of jitters inside it.
Double Click on Any Method Source code Converted to IL Code
// Code size 12 (0xc)
.maxstack 2
IL_0000: ldarg.0
IL_0001: callvirt instance string Infragistics.WebUI.CalcEngine.RefBase::get_NormalizedAbsoluteName()
IL_0006: callvirt instance int32 [mscorlib]System.String::GetHashCode()
IL_000b: ret
} // end of method RefBase::GetHashCode
This is the MSIL code starts with IL
If we can write code in IL code and understand it we can develop our own complier in the corresponding language.
There are around 30 third party language compliers available like COBOL.net,C#.net etc.

Resources

If assembly using any gif/image files that information is stored in resource section of the assembly. Note: To Examine the Components of the Assembly use Intermediate Language Disassembler (ILDASM) Go to
VS Command Prompt and type ILDASM
File -->Open the Dll
We can see the Manifest Meta Data ,IL Code Public key version number
This information can be helpful in determining whether a file is an assembly or part of an assembly, and whether the file has references to other modules or assemblies.

Advantages of .Net Assemblies

  1. No dll Hell
  2. Platform independency
  3. Inheritance is supported

Prototype Design Pattern

A Prototype Pattern is a creational design pattern used in software development when the type of objects to create is determined by a prototypical instance, which is cloned to produce new objects. This pattern is used for example
to avoid subclasses of an object creator in the client application, like abstract factory pattern does.
or when the inherent cost of creating a new object in the standard way (e.g., using the 'new' kkeyword) is prohibitively expensive for a given application.

C# sample code


public enum RecordType
{
Car,
Person
}

///
/// Record is the Prototype
///

public abstract class Record
{
public abstract Record Clone();
}

///
/// PersonRecord is the Concrete Prototype
///

public class PersonRecord : Record
{
string name;
int age;

public override Record Clone()
{
return (Record)this.MemberwiseClone(); // default shallow copy
}
}

///
/// CarRecord is another Concrete Prototype
///

public class CarRecord : Record
{
string carname;
Guid id;

public override Record Clone()
{
CarRecord clone = (CarRecord)this.MemberwiseClone(); // default shallow copy
clone.id = Guid.NewGuid(); // always generate new id
return clone;
}
}

///
/// RecordFactory is the client
///

public class RecordFactory
{
private static Dictionary _prototypes =
new Dictionary();

///
/// Constructor
///

public RecordFactory()
{
_prototypes.Add(RecordType.Car, new CarRecord());
_prototypes.Add(RecordType.Person, new PersonRecord());
}

///
/// The Factory method
///

public Record CreateRecord(RecordType type)
{
return _prototypes[type].Clone();
}
}

Performance Tuning

Performance tuning is the improvement of system performance. This is typically a computer application, but the same methods can be applied to economic markets, bureaucracies or other complex systems. The motivation for such activity is called a performance problem, which can be real or anticipated. Most systems will respond to increased load with some degree of decreasing performance. A system's ability to accept higher load is called scalability, and modifying a system to handle a higher load is synonymous to performance tuning.

Systematic tuning follows these steps:
  1. Assess the problem and establish numeric values that categorize acceptable behavior.
  2. Measure the performance of the system before modification.
  3. Identify the part of the system that is critical for improving the performance. This is called the bottleneck.
  4. Modify that part of the system to remove the bottleneck.
  5. Measure the performance of the system after modification.
    This is an instance of the measure-evaluate-improve-learn cycle from quality assurance.

A performance problem may be identified by slow or unresponsive systems. This usually occurs because high system loading, causing some part of the system to reach a limit in its ability to respond. This limit within the system is referred to as a bottleneck.

A handful of techniques are used to improve performance. Among them are code optimization, load balancing, caching strategy, and distributed computing, and self-tuning.

Builder Pattern

The Builder Pattern is a software design pattern. The intention is to separate the construction of a complex object from its representation so that the same construction process can create different representations.

For better understanding please see below an example in C# language to make use of Builder Pattern.

//Implementation in C#.
class Pizza
{
string dough;
string sauce;
string topping;
public Pizza() {}
public void SetDough( string d){ dough = d;}
public void SetSauce( string s){ sauce = s;}
public void SetTopping( string t){ topping = t;}
}

//Abstract Builder
abstract class PizzaBuilder
{
protected Pizza pizza;
public PizzaBuilder(){}
public Pizza GetPizza(){ return pizza; }
public void CreateNewPizza() { pizza = new Pizza(); }

public abstract void BuildDough();
public abstract void BuildSauce();
public abstract void BuildTopping();
}

//Concrete Builder
class HawaiianPizzaBuilder : PizzaBuilder
{
public override void BuildDough() { pizza.SetDough("cross"); }
public override void BuildSauce() { pizza.SetSauce("mild"); }
public override void BuildTopping() { pizza.SetTopping("ham+pineapple"); }
}

//Concrete Builder
class SpicyPizzaBuilder : PizzaBuilder
{
public override void BuildDough() { pizza.SetDough("pan baked"); }
public override void BuildSauce() { pizza.SetSauce("hot"); }
public override void BuildTopping() { pizza.SetTopping("pepparoni+salami"); }
}

/** "Director" */
class Waiter {
private PizzaBuilder pizzaBuilder;

public void SetPizzaBuilder (PizzaBuilder pb) { pizzaBuilder = pb; }
public Pizza GetPizza() { return pizzaBuilder.GetPizza(); }

public void ConstructPizza() {
pizzaBuilder.CreateNewPizza();
pizzaBuilder.BuildDough();
pizzaBuilder.BuildSauce();
pizzaBuilder.BuildTopping();
}
}

/** A customer ordering a pizza. */
class BuilderExample
{
public static void Main(String[] args) {
Waiter waiter = new Waiter();
PizzaBuilder hawaiianPizzaBuilder = new HawaiianPizzaBuilder();
PizzaBuilder spicyPizzaBuilder = new SpicyPizzaBuilder();

waiter.SetPizzaBuilder ( hawaiianPizzaBuilder );
waiter.ConstructPizza();

Pizza pizza = waiter.GetPizza();
}
}

Abstract Factory Pattern

Abstract Factory Pattern provides a way to encapsulate a group of individual factories that have a common theme. In normal usage, the client software would create a concrete implementation of the abstract factory and then use the generic interfaces to create the concrete objects that are part of the theme. The client does not know (nor care) about which concrete objects it gets from each of these internal factories since it uses only the generic interfaces of their products. This pattern separates the details of implementation of a set of objects from its general usage.

An example of this would be an abstract factory class DocumentCreator that provides interfaces to create a number of products (eg. createLetter() and createResume()). The system would have any number of derived concrete versions of the DocumentCreator class like FancyDocumentCreator or ModernDocumentCreator, each with a different implementation of createLetter() and createResume() that would create a corresponding object like FancyLetter or ModernResume. Each of these products is derived from a simple abstract class like Letter or Resume of which the client is aware. The client code would get an appropriate instantiation of the DocumentCreator and call its factory methods. Each of the resulting objects would be created from the same DocumentCreator implementation and would share a common theme (they would all be fancy or modern objects). The client would need to know how to handle only the abstract Letter or Resume class, not the specific version that it got from the concrete factory.

In software development, a Factory is the location in the code at which objects are constructed. The intent in employing the pattern is to insulate the creation of objects from their usage. This allows for new derived types to be introduced with no change to the code that uses the base class.

Use of this pattern makes it possible to interchange concrete classes without changing the code that uses them, even at runtime. However, employment of this pattern, as with similar design patterns, incurs the risk of unnecessary complexity and extra work in the initial writing of code.

Types Of Design Patterns: Defined

Creational Design Patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling this object creation.

Structural Design Patterns are Design Patterns that ease the design by identifying a simple way to realize relationships between entities.

Behavioral Design Patterns are design patterns that identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.

Design Patterns

Design patterns are recurring solutions to software design problems you find again and again in real-world application development. Patterns are about design and interaction of objects, as well as providing a communication platform concerning elegant, reusable solutions to commonly encountered programming challenges.
The Gang of Four (GoF) patterns are generally considered the foundation for all other patterns. They are categorized in three groups: Creational, Structural, and Behavioral.
Creational Patterns
Abstract FactoryCreates an instance of several families of classes
BuilderSeparates object construction from its representation
Factory MethodCreates an instance of several derived classes
PrototypeA fully initialized instance to be copied or cloned
SingletonA class of which only a single instance can exist
Structural Patterns
AdapterMatch interfaces of different classes
BridgeSeparates an object’s interface from its implementation
CompositeA tree structure of simple and composite objects
DecoratorAdd responsibilities to objects dynamically
FacadeA single class that represents an entire subsystem
FlyweightA fine-grained instance used for efficient sharing
ProxyAn object representing another object
Behavioral Patterns
Chain of Resp.A way of passing a request between a chain of objects
CommandEncapsulate a command request as an object
InterpreterA way to include language elements in a program
IteratorSequentially access the elements of a collection
MediatorDefines simplified communication between classes
MementoCapture and restore an object's internal state
ObserverA way of notifying change to a number of classes
StateAlter an object's behavior when its state changes
StrategyEncapsulates an algorithm inside a class
Template MethodDefer the exact steps of an algorithm to a subclass
VisitorDefines a new operation to a class without change

Agile Modeling

Agile Modeling is a practice-based methodology for modeling and documentation of software-based systems. It is intended to be a collection of values, principles, and practices for modeling software that can be applied on a software development project in a more flexible manner than traditional modeling methods.

Software Architecture

  • Architecture defines major components
  • Architecture defines component relationships (structures) and interactions
  • Architecture omits content information about components that does not pertain to their interactions
  • Behavior of components is a part of architecture insofar as it can be discerned from the point of view of another component
  • Every system has an architecture (even a system composed of one component)
  • Architecture defines the rationale behind the components and the structure
  • Architecture definitions do not define what a component is
  • Architecture is not a single structure - no single structure is the architecture
  • Architecture represents the set of earliest design decisions those are Hardest to change and Most critical to get right
  • Architecture is the first design artifact where a system’s quality attributes are addressed
  • Architecture serves as the blueprint for the system
  • Architecture establishes the communication and coordination mechanisms among components

Software Architecture - Definitions

IEEE 1471-2000

Software architecture is the fundamental organization of a system, embodied in its components, their relationships to each other and the environment, and the principles governing its design and evolution.

Booch, Kruchten, Reitman, Bittner, and Shaw

Software architecture encompasses the set of significant decisions about the organization of a software system

  • Selection of the structural elements and their interfaces by which a system is composed
  • Behavior as specified in collaborations among those elements
  • Composition of these structural and behavioral elements into larger subsystems
  • Architectural style that guides this organization

Perry and Wolf, 1992

  • A set of architectural (or design) elements that have a particular form

Boehm et al., 1995

A software system architecture comprises

  • A collection of software and system components, connections, and constraints
  • A collection of system stakeholders' need statements
  • A rationale which demonstrates that the components, connections, and constraints define a system that, if implemented, would satisfy the collection of system stakeholders' need statements

Clements et al., 1997

  • The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships among them

Windows SharePoint Services 3.0 Overview

Introduction
Microsoft Windows SharePoint Services 3.0 is a versatile technology that organizations and business units of all sizes can use to increase the efficiency of business processes and improve team productivity. With tools for collaboration that help people stay connected across organizational and geographic boundaries, Windows SharePoint Services gives people access to information they need.
Built on Microsoft Windows Server 2003, Windows SharePoint Services also provides a foundation platform for building Web-based business applications that can flex and scale easily to meet the changing and growing needs of your business. Robust administrative controls for managing storage and Web infrastructure give IT departments a cost-effective way to implement and manage a high-performance collaboration environment. With a familiar, Web-based interface and close integration with everyday tools including the Microsoft Office system, Windows SharePoint Services is easy to use and can be deployed rapidly.

Collaborate Easily and Effectively
Windows SharePoint Services helps teams stay connected and productive by providing easy access to the people, documents, and information they need to make more informed decisions and get the job done. Enhancements in Windows SharePoint Services 3.0 make it easier than ever to share documents, track tasks, use e-mail efficiently and effectively, and share ideas and information.

  • Provide a single workspace for teams to coordinate schedules, organize documents, and participate in discussions—within the organization and over the extranet.
  • Easily author and manage documents, and help to ensure their integrity with enhanced features including the option to require document checkout before editing, the ability to view past revisions and restore to previous versions, and the ability to set document-specific security.
  • Help people and teams stay on task with a variety of communication features that let users know when actions are required or important changes are made to existing information or documentation, including announcements, sophisticated alerts, surveys, and discussion boards.
  • Provide creative forums for brainstorming ideas, building knowledge bases, or simply gathering information in an easy-to-edit format with new templates for implementing blogs (also known as weblogs) and wikis (Web sites that can be quickly edited by team members—no special technical knowledge required).
  • Stay productive while mobile with enhanced support for offline synchronization through Microsoft Office Outlook 2007 that users can use to manage document libraries, lists, calendars, contacts, tasks, and discussion boards even offline, and to synchronize changes when reconnected to the network.

Get Started Quickly
As a built-in component of Windows Server 2003, Windows SharePoint Services makes it easy for IT departments to implement a dependable, scalable collaboration infrastructure with minimal administrative time and effort. Close integration of Windows SharePoint Services with familiar tools for authoring, publishing, organizing, and finding information, including the Microsoft Office system, helps users get up to speed quickly.

  • Simplify the creation and navigation of workspaces with the improved user interface and site creation tools in Windows SharePoint Services 3.0 that provide easy-to-use templates, professional-looking site themes, and the ability to rearrange site navigation from within the browser.
  • Make it easy for users to get up to speed quickly by providing integration with familiar productivity tools such as those found in the Microsoft Office system—users can create workspaces, post and edit documents, and view and update calendars on SharePoint sites, all while working within Microsoft Office system files and programs.
  • Track work and tasks more easily with enhanced integration with Office Outlook 2007 that helps users organize calendars, tasks, contact lists, discussion boards, and meetings.
    Customize workspaces with new application templates that provide custom scenarios for building workflows on the Windows SharePoint Services platform that address specific business processes or sets of tasks.
  • Implement a collaboration environment with minimal administrative time and effort, and with the flexibility to change deployment settings.

Deploy a Manageable Infrastructure
Deployment of Windows SharePoint Services 3.0 increases control over and enhances security of your organization’s data and information resources. Reduce the dependency of business units on your company’s IT department for site provisioning, implementation, backup, and support. Whether you’re a contributor to a team site, a site owner, or a server administrator, Windows SharePoint Services 3.0 provides better administrative controls for managing content, users, and sites so that individuals and teams can operate more efficiently and effectively.

  • Increase the security of business information with enhanced administrative controls that decrease cost and complexity associated with site provisioning, management, support, operations, and backup and restore.
  • Give IT better control over your organization’s infrastructure with new and improved services for controlling access to information and setting policies for site creation that enable security to be set as deep down as the item level.
  • Empower site managers and teams without compromising security by enabling them to initiate and control their own self-service workspaces and tasks, and manage the participation and access of others—all within parameters set by IT.
  • Provide a more robust document storage environment with document storage, recycle bin item retrieval, and version-control features built in to team workspaces.
  • Easily manage and configure Windows SharePoint Services by using a Web browser or command-line utilities, and enable a variety of custom and third-party administration solutions using the Microsoft .NET Framework.

Provide a Foundation for Web-Based Applications
With Windows SharePoint Services 3.0, IT professionals can tailor or extend the Windows SharePoint Services foundation to create new, efficient, Web-based tools and services specific to the organization, department, business process, or industry vertical. Through a highly customizable and extensible platform, companies can tie these new tools and services to existing line-of-business applications, capitalizing on existing IT investments and valuable information stored in back-end systems.

  • Manage business documents more easily with enhanced document library support and a common repository for document storage.
  • Use the Windows SharePoint Services platform to build rich, flexible, and scalable Web-based applications and Internet sites specific to the needs of your organization.
  • Take advantage of integration with Microsoft Office SharePoint Server 2007 that expands the platform services and common framework for document management exposed by Windows SharePoint Services to offer enterprise-wide functionality for records management, search, workflows, portals, personalized sites, and more.
  • Use Microsoft Office SharePoint Designer 2007 to quickly and easily customize SharePoint sites and build reporting tools and applications tailored to specific tasks without writing or deploying new code.