Monday, March 28, 2005

Wake Up to VS.Net 2005

In their own words, We have just released a glorious beast onto the world - Beta 1 of Visual Studio 2005.Even VS 2005 is in its infancy, but it has got some very useful capabilities this time those may be useful to increase individual productivity by many folds. There are some new features in VS IDE. The most prominent one is the use of partial classes. Other features I will discuss as we go ahead.I am going to use Express Editions of different products to show the new changes.

Before diving to any thing, I bring up one important point to you. After installing .Net Framework 2.0 Beta your existing applications may break, particularly Web Applications. Why because, when .Net Framework 2.0 is installed, it sets active ASP.Net version to 2.0. To fix that go to Default Web Site Propertiesdialog box and set the ASP.Net version back to 1.1 or 1.0 as opposed to 2.0.

Default Web Site Properties

Now while I am dealing with ASP.Net things, I would like to mention one another small change. Now you can change your Machine configuration and Web configuration files directly from Default Web Site property dialog box or from your web sites property dialog box.

ASP.Net Configuration Settings

Now we will look into some other new improved areas in VS 2005. Before going ahead you would like to visit the following link to see what is no more backward compatible:
http://www.gotdotnet.com/team/changeinfo/Backwards1.1to2.0/default.aspx

The prominent change I found in VS 2005 is support for Partial Classes. Now you can split your classes into multiple files. In previous versionswe were forced to implement a class into single file, irrespective of how large it is. In that case it was developers responsibility to write code in a sensible manner. Now with the help of partial classes you can write one particular section of code into one file and other one to other file. It is compilers job to merge all those implementation split into several files. We as developers have to implement partial class with the same name in all files then only compiler will be able to pick up correct definitions to merge into one class definition.Take a look into following example:
partial class Demonstration //Demonstration.cs
{        
public Demonstration ()
{
InitializeComponent();
}
}


partial class Demonstration //Implementation.cs     
{        
private voidInitializeComponent()        
{            

//Implementation Goes Here        
}    
}

Code of both the classes will be merged while compiling. In case of C# project, your code will be in FormName.cs file and control related information would be in FormName.Design.cs. The same is in case of VB 2005.

I found Partial class is the only common feature in VS 2005 through out the languages. All other features are specific to languages. Like in C# there is a new IDE feature called Refactoring. Basically refactoring means enhancing the existing design of your code. Refactoring is the art to make your code more readable, performance oriented and adhering to best OO practices. There are seven refactoring features as given below:

Extract Method - Allow to create a new method based on selected code.
Encapsulate Field - This turns a public field to a private field encapsulated by .Net property.
Extract Interface - Defines a new interface type.
Reorder Parameters - Provides a way to reorder member arguments.
Remove Parameters - Removes a given argument
Rename - Renames the provided code token.
Promote Local Variable to Parameter - Moves a local variable to the parameter set of the defining method

I will demonstrate, how to Rename a method. Select the method you want to rename and select Rename from either Refactor menu or from context menu.

Refactoring

VS 2005 will ask you for a new name for particular code token. Instead of blindly renaming, VS 2005 will show you the predicted changesin following manner:

Preview Changes

To read more about Refactoring go through following link:
http://msdn.microsoft.com/vcsharp/default.aspx?pull=/library/en-us/dnvs05/html/VS05_refac.asp

There are whole lot of changes in C# at language leve. Some major changes done to this finest language are Generics, Iterators and Anonymous methods. However these things are now supported at CLR level, that means all langauge will enjoy these new features. I think these topics are vast enough in themselve and need separate treatement. I will not deal with these things right now.

However I will show you one amazing enhancement in VB 2005. VB developers will just love this fetaure. This is called My. This fetaure is implemented under My namespace. My provides you full control over your computer resources, user identities and not to say on your application. Suppose you want whether you are connected to network or your mouse is working or not, you can get all these information using My.

My

You can use Exists* property of Mouse to get the status.To find out network connectivity you can use IsAvilable* property of Network. You can further explore the power of My.

Before wrapping this off, I will tell you little about SQL Server 2005 Express. Right now there is no tool is out for this, one like Enerprise Manager to SQL Server 2000. I heard that you can connect to SQL Server 2005 Express using Quesry Analayzer of SQL Server 2000. If you really want to mangle with database using visual tool, then try to connect to database from VC# express or VB Express.

SQL Server in Action

Make sure before trying connecting to SQL Express, you start your SQL Express instance from your Computer Management Console. Run COMPMGMT.MSC and follow the nodes Service and Applications -> SQL Computer Management - > Services -> SQL Server. Then start your particular SQL Server instance. You will able to accomplish almost everything expected from SQL Serever.

Here I covered some new features those will come with VS 2005. I have not coverd any thing at the CLR level or language level. It sure that some of the things covered here may change, when final version of .Net Framework will ship. The fetaures covered here were to make you aware about forthcoming spices with .Net and to put you onto to gear with .Net Framework 2.0.

Note: Exists property of Mouse will not be available in next release of .Net 2.0 due to a bug reported by me. IsAvailable property of Network is also being diagnosed and I am doubtful about it existance in the next release of .Net.

Developing Windows Applications - III

Its very rare that one application doesnt take any input from user. Almost all application depends upon users input in some sort. In most application user enters information through user interface. Data validation ensures that all data entered by user falls under the acceptable reason. For example you asked user to give the time she worked. Here application has to validate that she should not give more than 24 hours. Even 24 hour is also non human but acceptable. Purpose of validating user data is to develop robust application and not to have any unexpected behavior at application or database level.

We can categorize validation in two categories.
1. Form-level validation
2. Field-level validation
Form level validation can be termed as where you require values in some fields must be provided. In such scenarioyou at least need some sort of values. From level validation is usually performed when user is about to submit her inputs. In case of field level validation you check for value whether it is under acceptable range or not.

Field-Level Validations
TextBox is much used control that is used to take user inputs. So the way it provides some properties to control user input in specific manner. Some of these properties include:

· MaxLength
· ReadOnly
· PasswordChar

MaxLength
This property lets you set the maximum number of character a textbox can take.

ReadOnly
If set this property makes a textbox to behave in non editable mode. A user would not be able to make any changes to content of textbox.

PasswordChar
Though not restricting user to some particular value, but useful because passwords are sensitive data and should be displayed in non readable mode. You can give any character as PasswordChar and when user types, her password will be non readable to others.

Using Events to perform Field-Level validations

KeyPress
This is an important event to track while performing field-level validation. This is event is fired when user presses a key that has corresponding ASCII value. This excludes special keys like CTRL, SHIFT, ALT, DEL, arrow keys etc.Rest all keys we can track in this event. KeyPressEventArgs is the type of event that is passed to the event handler of KeyPress. KeyPressEventArgs provides us KeyChar and Handled property. KeyChar contains the key that was pressed. If we set Handled property as true then that key will be treated as user has not pressed that key. Char class provides us methods perform some basic validation for each key that is pressed. These methods include:
· Char.IsNumber
· Char.IsDigit
· Char.IsPunctuation
· Char.IsLetter
We can perform validation as shown below:
private void textName_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{

if (char.IsNumber(e.KeyChar) || char.IsPunctuation(e.KeyChar))
{
//Dont pass it to textbox. Filter it here.
e.Handled = true;
}
}


The Validating and Validated Events
Easiest way to validate user data is to validate it in Validating event. Validating event occurs before control loses focus. This event is occurred when CausesValidation property of control that is about to receive the focus is set to true. To use Validating property CausesValidation of control to be validated should also be true. By default all controls have CausesValidation set to true while they are created in design mode.Validating event takes one parameter of type CancelEventArgs. It does have Cancel property. Set it to true, if you want to push the focus back to control for which validation is failed.
Validated event is fired when a control is successfully validated. Following is the way you can implement validating event:

private void textName_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
if (textName.Text.Equals(string.Empty))
{
e.Cancel =
true;
}
}


The code shown above will force user to enter at least one character in name field. Without entering some value user cant leave this textbox. Even user cant close current screen. Did you recall something at this point? Yes, we should not force user to behave in some particular manner. They would not like it. I have described Validating event for sake of completeness of this discussion, however in my humble opinion you should avoid Validating event as it forces user to enter data in a very rude manner.

Form-Level Validation
Form level validation is a way to implement validation for all input controls at once. To perform form level validation we can implement centralized procedure that will be consulted before user us about to go to next level. We can implement form level validation is following manner:

private bool ValidateData()
{
f
oreach (Control control in this.Controls)
{
if (control.Text.Equals(string.Empty) && control is System.Windows.Forms.TextBox)
{
MessageBox.Show("You can't leave " + control.AccessibleName + " empty",
"Validation Test");
if (control.CanFocus)
{
control.Focus();
}
return false;
}
}
return true;
}


To ensure, this code flags error message in correct sequence, you have to make sure that you added the controls to Forms.Control collection in a desired sequence. Otherwise it willflag the message for bottom most control in form before other controls.

The ErrorProvider Component

The ErrorProvidercomponent provides an easy way to communicate validation errors to your users. The ErrorProviderallows you to set an error message for each control on your form whenever the input is invalid. An error message produces an error icon next to the control, and error message text is shown as a Tool Tip whenthe mouse hovers over the affected control. The ErrorProvider component is found in the Windows Forms tab of the Toolbox.

Using ErrorProvider
Following are the steps to accommodate ErrorProvider:
1. Drag and drop ErrorProvider component in your form.
2. Call its SetError method, when validation is failed.

SetError method takes two parameters. First one is the control for which validation is failed. Using this value ErrorProvider will blink error icon next to the control. Second parameter is string value that will be shown when user hovers her mouse over blinking error icon. Following is the demonstration to accommodate ErrorProvider in code:

private void textName_KeyPress(object sender,
System.Windows.Forms.KeyPressEventArgs e)
{
if (char.IsNumber(e.KeyChar) || char.IsPunctuation(e.KeyChar))
{
e.Handled =
true;
errorProvider.SetError(textName,
"Name can not have numbers or punctuation marks");
}
else
{
errorProvider.SetError(textName,
string.Empty);
}
}


When you feel that validation is successful, call SetError method with empty string. This will clear the blinking error icon. You can further customize ErrorProvider by setting BlinkRate and BlinkStyle properties of ErrorProvider control. These properties are self explanatory. Arent they? Using BlinkRate we can control the blink rate of ErrorProviders error icon.BlinkStyle will let you decide when to blink, when not to or not at all.

We have covered many aspects of windows applications however we feel that it is not even the tip of iceberg. But we are at the point from where you can take off. Better luck and all the best with .Net windows programming.

Developing Windows Applications - II

Did you go through previous article in a careful manner? Didn't you miss anything there? Yes! We didn't talk about toolbar and status bar in our previous article. Here we will have a look into toolbar and status bar plus validation controls and other tips about windows forms.

Toolbar
Toolbar is another important aspect in Windows application. It's a rare instance when an application doesn't have toolbar with it. ToolBar contains the collection of ToolBarButton. It's the collection of ToolBarButton that makes visual representation of toolbar. To add a toolbar to your application go to View ' Toolbox. Select ToolBar control from toolbox and drop it on the form. This action makes a blank strip at top edge of your form. That is the toolbar. Now you got a question. How to add buttons to this blank strip? Simple; Right click on this strip or now onwards a toolbar. Select Buttons property and you will get another window something like given below:

ToolBar-I

Now you are free to add as many toolbar buttons as you want. Give proper values to Name, Tag, Text and ToolTipText property. Notice Style and ImageIndex properties. These are two crucial properties for toolbar. Style property is used to set the button of proper type. Whether you want toggle button in toolbar or should it be a separator. ImageIndex will be useful to assign a proper image to button of toolbar.

To have images in our toolbar we have to use another control, ImageList. ImageList provides methods to manage a collection of Images objects. ImageList is typically used by other controls, such as the ListView, TreeView, or ToolBar. You can add bitmaps, icons files to the ImageList, and the other controls are able to use the images as they require. To add ImageList to your form drag it from toolbox to your form. As it is not a visual component, it will sit in component tray. To assign images to ImageList, select its Images property. This property will let you visually add images to ImageList. Once you are done, come back to property window for toolbar. Pull down the drop down menu of ImageList property and select the appropriate value. You should have it as the name you gave to your ImageList component.

Now we come to our original topic. We were supposed to add images to our toolbar buttons. Here are the steps to do that:
1. We should have ImageList in our Form. We do have now!
2. Add images into this ImageList component. We have done that!
3. Assign ImageList property of toolbar as the ImageList component we have added. Done!
4. Click on Buttons property of toolbar and now you will have appropriate values in ImageIndex property as shown below:

ToolBar-II

Once your toolbar is visually ready, double click on this. You will get an empty event handler, where you will have to identify that which was the clicked button. That we have to do based on its index in following manner:

private voidtoolBar_ButtonClick(object sender, System.Windows.Forms.ToolBarButtonClickEventArgs e)
{

switch (toolBar.Buttons.IndexOf(e.Button))
{
case 0:
//Your code goes here
break;
}
}


Status Bar
Status bar is used to inform user about certain kind of activities or some static data such as current date etc. To add status bar to your form, drag and drop StatusBar control from toolbox to your form. It will be bottom docked to your form by default. StatusBar has a property panels that is collection of StatusBarPanel.This makes visual representation of status bar and we have to assign text values to these panels. To get your status bar up, follow given below steps:
1. Drag a status bar to your form.
2. Go to property window and selects Panels property.
3. Add panels to your status bar in a similar manner as you added toolbar buttons to toolbar.
4. As a final step, give some proper value to each panel when your form loads.

One little issue is here. To show your panels make sure you have ShowPanels property is set to true. By default this is set to false, I dont know why. You can set values of panels as given below:
statusBar.Panels[0].Text = DateTime.Now.ToShortDateString();
statusBar.Panels[1].Icon = SystemIcons.Information;


At this point we have decorated our application to look good enough. Following is the descriptions about some Form properties through which you can make you application behave better too.

AcceptButton
This is the property, when you want to accomplish some task when user hits Enter key. You will have all buttons those are part of your form listed in this property. Select one button from the list, you would like to act when user hits Enter key.

CancelButton
Button selected under this property works when users hits Esc key.

KeyPreview
You can track the keyboard on KeyDown, KeyPress and KeyUp events. But these events will be fired only when your form or particular control connected to these events is having focus.If any other control on your form is having focus and you are tracking a key on form level, you will never be notified. Should you ever get into situation like this? You set KeyPreview property as true and now you can track entire keyboard at form level. Form will be the first control to receive all the messages coming from keyboard. Once Form does the processing, then only message will be passed to other controls.

MinimumSize
Do you ever get into situation where you have to retain a minimum size of form? User should not be able to resize the form once she reaches the given points? In such situation, use this property. Assign it the minimum size of form that you would like to retain.

Opacity
Have you ever dreamt to make your form semi-transparent? Then your dream has come true. By default this property is set at 100%. That means your form will be opaque. Just play with this property to adjust opacity of your form.One caution: In property window this is treated in percentage. If you happen to set it through code part, you have to set it in following manner:
//To Set opacity at 50%
this.Opacity = 0.5;

While covering these aspects of windows application, I happen not to cover some simple controls like TextBox, Label etc. I leave these controls and other windows controls on you to explore further. You will find your journey really exciting to explore these controls. In next article we will see how can we validate user input?

Developing Windows Applications - I

After getting through basic guidelines to design Windows Application, we should now get our hands to basic elements of Windows Application. If we are talking about the windows elements, then in this case first element is Windows Form itself. Its like a drawing board, where all the drawing will be done. Windows form is defined inside System.Windows.Forms namespace. Control is its grand parent class under the same namespace. Control class has to be inherited by every component that has to have visual representation. Now its time to dive deeper into windows applications.

Visual Inheritance
Inheritance is not limitedto only classes those are having business logic. As Form itself is a class with visual appearance, rules of inheritance applies to Form too.This feature is handy when you want to retain some kind of image or theme through out all screens in your applications. You can accomplish this task in two ways. One way is through code:

public classParentForm : System.Windows.Forms
{
// Necessary elements to build a form
}

public class ChildForm : ParentForm
{
//Visual elements
}

Do you notice one thing in this code? ChildForm is not inherited from System.Windows.Forms. It is inheriting from ParentForm. This way our ChildForm will get all the visual elements and other characteristics those are there in ParentForm.
Other way to accomplish this task is inheritance picker in Visual Studio .Net. Following are the steps to use inheritance picker:
1. Right click on your project, select Add Add Inherited Form.
2. Select Local Project Items UI in opened dialog box.
3. Choose Inherited Forms and give a name for your child form. Click OK
4. Inheritance picker will come having all forms available for visual inheritance in your project.
Inheritance picker will resemble the screen given below:

InheritancePicker

Menus
Another basic aspect of any application is its Menus. In .Net we have facility to design our menu items through a menu designer. Main menu item is designed using a component MainMenu. It manages the collection of MenuItem controls, which form the visual element of menu structure. With the MainMenu component you can develop menus in an intuitive and rapid manner.

To add MainMenu in your form just drop it to your form from ToolBox. It will go and sit in component tray in Visual Studio.Net. It wont be a visible element in your form design. Select it and you will get a Type Here text in Menu bar of you form. Click there and you have your first MenuItem.

Now some tips to make your menus to resemble professional menus.
1. Logical Grouping: To group or separate your menu items on logical basic, create a menu item and give - as its Text property. This will make a horizontal seperation between menu items.
2. Access Keys: Most of the users like to have a way to menus through keyboard. Access key is a combination of ALT + character that can fire the command of a menu item. For example in above figure F in File is an access key. To achieve this precede the text of menu item with &. For example I gave &File as the text of menu item and now ALT + F will have effect same as of clicking the File using mouse.
3. Shortcut Keys: Shortcut keys enable instant access to menu commands, thus providing a keyboard shortcut for frequently used menu commands. Shortcut key assignments can be single keys, such as Delete, F1, or Insert, or they can be key combinations, such as Ctrl+A, Ctrl+F1, or Ctrl+Shift+X. When a shortcut key is designated for a menu item, it is shown to the right of the menu item. To show shortcut key, set ShowShortcutproperty of menu item to true. To assign a shortcut key to any menu item set the particular menu items Shortcut property from the drop down menu.

To make your menu item to work, simply double click on it. Visual Studio .Net will code an event handler for you as given below:

private void menuFileNew_Click(object sender, System.EventArgs e)
{

//Your code goes here
}

If you expand Windows Form Designer generated code region you will come to know that it has also created the association between click event and its handler as shown below:


this.menuFileNew.Click += new System.EventHandler(this.menuFileNew_Click);

Isnt it so simple? You just got to code for particular event. No other nonsense code :)

MenuExaple

Dock Property
Every windows control has one property called Dock. Its an inherited property from Control. Docking refers to attaching your particular control to one of the edge of parent control. Parent control is usually Form, but it can be anything from Tab control to panel.An example of a docked control can be a menu bar docked to top of form or a status bar docked to bottom of form.

To set the docking property of control,simply select that control and select Dock property in Properties window. You will get visual interface similar as show aside to set the docking. If you click the top bar, docking will be set as Top. To remove docking for your control, choose None. Selecting middle bar causes your control to fill entire available area of its parent as it is a Fill docking.

Docking

Anchor Property
If you see the above figure, you will see Anchor property before Dock property. Anchor is also an inherited property from Control. This property lets you to set a constant distance for your control from one or more edges of form. Let me explain this by an example. Lets assume that you have designed one wonderful screen as given aside. But user resizes this screen and then your screen looks like as given below.

Anchoring-I
Anchoring-II

Are you ready to deal with such kind of situations? Let your interface deal with such scenario in a graceful manner. Anchor is property that saves you in such kind of scenarios. Anchor property allows you to manage how controls respond to resizing the form. You can allow controls to remain fixed in the form by anchoring them to the top, left, right and bottom edges, cause them to stretch when resized, or allow them to float freely by releasing the anchor. To set the Anchor property of, select your control and then select Anchor property in Properties window. You will get another visual interface. Select the Anchor type you would like to give to your control. To deal with situation described in our example, anchor controls to bottom, right edges of screen. This will let your controls to keep a constant distance from bottom of form as well as from right of from. You can very well use Anchor and Dock properties while designing UI. But one caution, when Dock property is set, it makes Anchor to be as Top, Left.

Anchoring-III

In this article I brought theoretical concepts of inheritance to real world use. We got to know how to beautify our applications with menus. We saw some very handy properties like Dock and Anchor which can be helpful to deal with users actions against our screens. Hope you enjoyed this small tour to Windows applications.

Wednesday, March 23, 2005

Designing Windows Applications

In coming lines I willtry to figure out the guidelines of an intuitive User Interface. Have you tried to figure out the mind set of your user? Here are three major points why user may treat your software as hard to use:

1. User is not really concern about applications conceptual model: You might have followed a nice concept through out your application, but does it help your end user to accomplish her task. Its not like that your users are dumb. The fact is that they are inundated with daily routine and information. They dont have time and energy to understand the conceptual model behind your great software.
2. Most users dont master common procedures:While developing a new feature in your software you thought, after a while user will get used to that feature. But according to one study, users do not really notice the procedure when they are accomplishing one task. They may stumble while doing the same task in some future point.
3. Users face the problem to find the purpose of screen: You developed software for a user who has mastered the common procedure and conceptual model, but for majority of users each screen would be unwanted puzzle.

The best solution to deal with these problems is to develop a UI that is easy to learn and self explanatory. Users must be able to find out the feature every time they need it and they must be able to use that feature every time they want to.

Deductive User Interface
Now a days most software forces their users to infer the purpose of software. For example look at the screen below:

UnUsable

Experienced computer user like you and me will come out saying;oh this is a simple screen to add some items to list box provided there. And other buttons are there to further give some sort of functionality to this screen. But did you notice one thing in this screen.It is nowhere written the purpose and behavior of this dialog box.

Now just slide yourself into end users shoes. You will find one obvious question, What should I do with this dialog box? One another big point is when this dialog box pops up to user, she has to stop her current work and find out what this screen will do for her.

A normal end user may try to type in directly to list box as it appears like a normal edit box. End users will be detracted from their usual task when they have to figure out the behavior of screen. You might wonder why a user cant figure such a simple task. But according to studies most users are even confused about the capabilities of their software. They have difficulty understanding what the product can do for them, whereto go to perform an operation, and how to perform that operation once they have found it.
A Solution to this
The most basic solution to come out of this issue is Inductive User Interface (IUI). IUI's goal is to reduce the amount of extraneous thinking users must do to successfully move between parts of a product and use its features. The word inductive comes from the verb induce, which means to lead or move by influence or persuasion.

You can define IUI as an extension web-style interface, where each pagehas to be simple and task based because each piece of information has to be sent back to server and it should be correlated to primary task of that page. A well designed inductive interface help users to find answer to following two questions:
· What am I supposed to do now?
· Where do I go next to accomplish rest of the task?

A screen with a single, clearly stated, explicit purpose is easier to understand than a page without such a purpose. This fundamental premise can be expanded into a series of four steps for designing software that uses inductive interface:
1. Focus each screen on a single task.
2. State the task.
3. Make the screen's contents suit the task.
4. Offer links to secondary tasks.

Going forward we will try to change our dialog box to suit above four point. How? We will see...
Step One: Focus each screen on a single task. Each of your screens should be based on one primary task.Now how will you come to know about the primary purpose? You may express bunch of tasks as one task, if that are abstract enough to group in to one. So here is the rule of thumb; a screen is focused on one purpose if the designer can express that purpose with a concise, meaningful, and natural-sounding screen title. In our example we can define the primary task as to Change Item Details.

Step Two: State the Task. Each of your screens should have concise and explicit statement of its primary task. As we have given, Change Item Details.
Now just have a look on modified screen:

Usable

Step Three: Make the screens content suit the task. Did you interpret screen content as the text that you will put on the screen? No. Its all about the controls those are going to have on your screens. Controls on screen make the content of your screen. User should be able to easily figure out how to achieve their task. For example if you see, now our dialog box is having Remove and Details...button enabled. This facilitates user to click on these buttons rather then puzzling, when the become enable. By doing this you will have much more impressive effect on user when user clicks one of these buttonswithout selecting any item in listbox and alert her that she first has to choose one item from list. Another thing is to provide a clear exit to user, when she is done with her job. Dont try to retain her on screen saying, You HAVE to add at least one item. If she wants to go out of screen, let her do that. Being an intelligent software developer, take care of such scenarios in your code.

Step Four: Offer links to secondary tasks. Do you see our Details... button? In our modified dialog box it is enabled and provides the link to one secondary task. Clicking this user can go to next screen. Then it depends upon you, how much functionality you are giving her in next screen. However be sure give clear exit from next screen too and that screen also should follow usability guidelines as much possible.
We are through with basic guidelines to design Windows Application. Beside this you should also keep consistency through out your screens as far as controls font, size, placement and their grouping goes. Use color contrast to enhance users experience not to damage his confidence in your software. For Example Green text on Red background may look great to you, but just think about a user who is color blind to Green color. Hope all this discussion benefits you to develop your next great application.

Friday, March 11, 2005

Oracle SPs in C#/VB.Net

Do you know that Oracle's ODP.Net team is planning to give support for C#/VB.Net SPs too. That means soon Oracle will empower its RDBMS product to have SPs written in C#/VB.Net. Right now ODP.Net plug in allows you to do every thing that you can do with Server Explorer against SQL Server. You can create a new table, edit existing table, create a new SP, run a SP and get the result in a nice datagrid.
For a long time Oracle dedicated itself to Java language. They never really liked the concept of .Net and C#. But now what forced them to provide support for C# SPs is market share. Every one wants to extend their market share and to retain it. In many cases each project going to C# means backend might be SQL Server rather than Oracle. Now Oracle is forced to provide support for C#/VB.Net projects too. Good Step!

EntLib Binaries are Not Signed

If you have downloaded EntLib and started playing with it, you would have noticed that it comes with all of its source code and none of the assemblies are signed with a key. Why it is so? It is because of support issues. If Microsoft had come up with the signed files and binary only version then they would have to support it too. You should have notice one checkbox while installing EntLib, "Compile Enterprise Library". That is the point when EntLib's source code is compiled into binaries for you.
Microsoft Pattern and Practices group did not want to ship a product kind of thing. Microsoft EntLib is the guidance for rest of the world. It just guides you in your way to design and develop your enterprise application. So if you come across any issue while using EntLib, you can't ask for support from Microsoft. But you can very well pop the question in EntLib community. That's why I suggest you to join EntLib community. In case you are not happy with this situation, then just wait for a while. We are coming with ACA.Net V4.0. That will have signed version of EntLib binaries and you will get a full support from Avanade. Nobody can support EntLib better then us; after all its we who built it!
ACA.Net 4.0 gives you some very exciting fetaures on top of EntLib. ACA.NET 4.0 provides a service oriented application platform. Service oriented techniques typically produce coarsely grained, loosely coupled applications that can communicate with each other to compose large systems that deliver complex functionality. Using the principles of SOA, architects can build powerful distributed applications that are more flexible and easier to maintain over time than solutions built around distributed object technologies. Beside this ACA.Net 4.0 facilitates you to leverage your application with Aspect Oriented Architecture (AOA). The Aspect Architecture provides a flexible way to declaratively add behavior to your applications. It serves as the glue between the Service Architecture and the "sideline" Frameworks. If you want AOA and SOA features in your application, give a try to ACA.Net 4.0. Its free for use, however you will have to sign a license for our comfort.

Enterprise Library is Out

Finally Microsoft Enterprise Library is out. Enterprise library is collection of reusable software assets to address common enterprise development challenges, consistently, correctly and quickly. If you are not new to MS platform, you might be familiar with Applications Blocks, i.e. Data Access Block and Exception Management Block. There were several other application blocks as well.
In a much simple way you can define Enterprise Library as the collection of all old application blocks. But in a techie way you can not do so. Its first version is produced in partnership with Avanade, leveraging experience from customer engagements and incorporating aspects of the ACA.NET application framework. In first version of Enterprise Library you get following blocks:
  1. Data Access Application Block

  2. Exception Handling Application Block

  3. Configuration Application Block

  4. Caching Application Block

  5. Logging & Instrumentation Application Block

  6. Security Application Block

  7. Cryptography Application Block

Take the example of DAB. In EntLib aim was to keep to simplicitiy of DAB, and it is maintained. However it is refined further. Support for multiple database through database factory (SQL Server, Oracle, DB2 etc.) is added to EntLib that was not available in the age of DAB.
Exception Management Block is now known as Exception Handling Block. Now you can configure your exception using XML file. You can define different kind of policies (Global Policy, Wrap Policy, Replace Policy) and that too with full configurabililty. Thanks to EntLib Configuartion Console. EntLib Configuartion Console is code based on Avanade's ACA.Net Configuration Manager(See the snap shots). Actions provided through EntLib are extensible; we provide Logging, Wrapping one exception with another, and Replacing one exception with an other.

EntLib.JPG

Avanade Configuration Manager.JPG

Finally on behalf of Microsoft and Avanade, I invite you to join EntLib community site at:
http://www.gotdotnet.com/workspaces/workspace.aspx?id=295a464a-6072-4e25-94e2-91be63527327