Moustafa Refaat
Login   Search
Skip Navigation Links
Home
Publications
Service Offerings
Downloads and Samples
My Resume
Endorsements
Contact Me
Books
Technical Articles
Software Packages
Scroll up
Scroll down
BizTalk The Practical Course
Mastering The BizTalk Technical Interview
Soduku:Challenging Puzzels
Scroll up
Scroll down
Design Patterns Review
Software Architecture Basics Review
Simplified BizTalk Content Based Routing for a Pass_Throu data
An Extensible Light Xml Rules Engine Component
Secure Messaging Solution
Create a SQL Database Programmatically
BizTalk Unzip Adapter
Implementing Singleton pattern with BizTalk Orchestrations
Developing BizTalk Custom Adapters
The BizTalk ESB Toolkit 2.0 experience Series
Scroll up
Scroll down
Setting the ESB Toolkit on the 64 Bit Machines
How The ESB Works
Sample Custom Resolver
Scroll up
Scroll down
Recent Training
Scroll up
Scroll down

News List

  • Toronto Code Camp Presentation is uploaded
  • BizTalk: The Practical Course is recommended by Micorsoft
  • Canadian Gigs Network (www.CanadianGigs.Net) a job web site focusing on Canadian Jobs
  • BizTalk Technical Interview Preparation
  • GT-DataSafe© Online Backup for Amazon Storage Services 3.0 is released
  • Soduku Challenging Puzzles
  • BizTalk: The Practical Course
  • Mastering The BizTalk Technical Interview is Published.

Technical Articles

  • SharePoint List Simplified Configuration Store
  • WCF and xsd:choice how to implement!
  • WCF: Refactoring a Plain old XML web service to a WCF Service
  • Setting the ESB Toolkit on the 64 Bit Machines
  • The BizTalk ESB Toolkit 2.0 experience Series
Skip Navigation Links
> Blog entries about: Exception Management
Create a SQL Database Programmatically

In this article I will explain how to use MS SQL Management Objects (SMO) to create a MS SQL database from C# code. In this sample will

  1. Enumerate all the SQL servers in the network and fill a list box where the user can select one of the servers.
  2. The user will enter the Database Name to create.
  3. The user will enter an AD account to grant right to.
  4. When the user click "Create Database" the system will check for the existence of the database.

Read More..

{10/01/2009 1:34 PM} {0 comments}  {Tags: Architecture, Deployment, Exception Management, SQL Server}
An Extensible Light Xml Rules Engine Component
 The Extensible light XML rules engine component allows the easy configuration of rules in XML, definition of the interpretations of rules and the actions to be taken by client code. Though the component idea is simple its extensibility and completeness makes it worth of reuse. The component is developed in C# and .Net framework.  Read more..
{10/01/2009 1:25 PM} {0 comments}  {Tags: Architecture, EAI, Exception Management, Security, Busienss Rules}
Designing Exception Management
All applications will have errors occur during their operation, both expected and unexpected types of errors. When errors occur, how should they get handled by the application?
What makes exception management challenging:
  • There are issues with determining who gets notified of errors, is it always the user?
  • Security people are quick to point out that error messages can include information that could be used for compromising the system. The classic example being “connection string X failed” and the connection string contains the database username and password.
  • System administrators need to know when problems are happening, but do they need to know about every error? Error reporting to the system administrator can actually be very complex because it could be a group of system administrators or even include the business owners of the application. So there might be a whole workflow to how errors get reported to the people who own and maintain the application.
  • How should errors be propagated within the architecture? Are errors always handled at the closest point to where they occur, or use some kind of global exception handling?
Best Practices in handling exception management:
  • Categorizing errors as “business” versus “technical” errors is necessary to support sophisticated exception management.
  • Sometimes exceptions are not necessarily errors, but are expected and the business logic takes an alternate successful path, and so in those cases the exception can be handled locally in the code where they occur. Otherwise exceptions are propagated up until it reaches the system boundary where a global exception handler reacts to the exception.
  • The propagation is done using normal .NET try/catch/throw exception handling. Developers sometimes think about using error codes because of older C style conventions or concern over performance of .NET exception handling, but performance for failed requests typically isn’t an issue.
  • Business exceptions get raised by the business logic when errors such as a business rule violation or validation error occurs. Business exceptions are also always raised with a safe and user acceptable message.
  • At the system boundary in the global exception handler, all technical exceptions should be logged for the system administrator and include a unique log id. The message returned to the user should be replaced with a generic error message so unsafe information does not get leaked out of the system. But the generic error message must include the unique log id entry, so if the user contacts the system administrator for help, then the administrator can determine the actual technical error message by looking up the log entry using the unique id. This saves time and prevents the system administrator from having to ask the user what time the error happened, can they reproduce the error again, etc. 
{09/06/2005 5:25 AM} {0 comments}  {Tags: Architecture, Exception Management}

Copyright © Moustafa Refaat 2004 - 2009. All Rights Reserved.