Learn IT

Free learning anything to everything in Information Technology.

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.

3-Tier Architecture Implementation for Web Applications

A 3-Tier Architecture implementation in a web based application scenario is defined as three layers of hardware, as in “web server + application server + database server”. Although it is possible to physically deploy a software application over three layers of hardware, we must divide the application code into three layers of software to begin with so that we actually have something that can occupy each piece of hardware. The former is known as physical 3-tier while the latter is known as logical 3-tier. It should be possible for a logical 3-tier application to be deployed on a single physical device as well as several devices. It is a deployment strategy to decide the installation of the system; we will only describe the logical 3-tier here.
The three logical layers are defined as:
  • Presentation logic - accepting user input and generating user output - the User Interface (UI).
  • Business logic - the processing of business rules and task-specific behaviors.
  • Data Access logic - communicating with the physical database using the APIs provided by that database engine.

These areas are also referred to as layers or tiers.
This pattern can be represented in the following diagram:

The presentation layer never talks to the data access layer directly - it talks only to the business layer. The business layer receives requests from the presentation layer, which may be:

  • Requests to read data, in which case the business layer may instruct the data access layer to obtain the data from the database. Note that a single request may not be limited to a single database table.
  • Requests to write data, in which case the business layer will apply the relevant validation rules before instructing the data access layer to write it to the database. Note that a single request may not be limited to a single database table.

Among the advantages of separating the application logic in this manner are:

  1. Maximises code reuse and minimises code duplication. For example, each business entity has a single component in the business layer, and all presentation layer components which want to access this business entity go through the same business layer component.
  2. It is possible to modify the application by making changes to just one tier, leaving the other two unaffected by the change. For example: It should be possible to change the presentation layer, such as from client/server to the web, without affecting the business or data access layers. It should be possible to change the business rules for an entity without affecting the presentation or data access layers. It should be possible to change the data access layer, such as switching from one database engine to another, without affecting the presentation and business layers.
  3. As each tier is now independent of the other it becomes possible to use different sets of developers, with different skill sets, for each tier. This may reduce the need for multi-skilled developers.