Categories
.NET C#

Regular expression for US and Canada phone number

Regular Expressions
Regular Expressions (Photo credit: Jeff Kubina)

This a quick post regarding how to validate US and Canada phone number in very possible formats.

Requirements:

To determine whether a user entered a North American phone number in a common format, including the local area code. The supported formats are 1234567890, 123-456-7890, 123.456.7890,  123 456 7890, (123) 456 7890, and all related combinations. If the phone number is valid, we will convert that our standard format,  (123) 456-7890, so that the phone number records are consistently recorded.

Suggested expression: ^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$

Valid phone number series for the expression:

  • 123-456-7890
  • 123 456-7890
  • 123-456 7890
  • (123)-456-7890
  • 123 456 7890

 

.NET C# Code Snippet

string userInput = txtPhoneNumber.Text;

Regex regexPhoneNumber = new Regex(@"^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$");

if (regexPhoneNumber.IsMatch(userInput))
{
	string formattedPhoneNumber = regexPhoneNumber.Replace(userInput, "($1) $2-$3");
}
else
{
	// Invalid phone number
}

The following layout breaks the regular expression into its individual parts, excluding the repeating groups of digits:

^ Assert position at the beginning of the string.
\( Match a literal “(“
  ? between zero and one time.
( Capture the enclosed match to back reference 1
  [0-9] Match a digit
{3} exactly three times.
) End capturing group 1.
\) Match a literal “)”
? between zero and one time.
[-. ] Match one character from the set “-. “
? between zero and one time.
? [Match the remaining digits and separator.]
$ Assert position at the end of the string.

Here, ‘^‘ and ‘$‘ are meta-characters named an anchor or assertion. ‘^ is used to mask the start of regular expression and $ is used to mark the end. ‘$’ is used to stop matching too much string into final result than required.

 

For people seeking more information regarding the expression are suggested to visit detailed post here: http://blog.stevenlevithan.com/archives/validate-phone-number

Categories
SQL

Replacing first occurrence of certain characters in MSSQL database

This post is regarding how to replace first occurrence of one or more characters from database table Column.

Suppose we have table named User with columns Id, Name, Phone Number as shown in the figure below.

User database table
User database table

And contains records as shown in figure below:

User records before script
User records before script

Now what I required to accomplish is replace the first ‘-‘ character with space ‘ ‘ so that for example phone number 214-654-1800 becomes 214 654-1800. The script for this as below and next to it is the resulting data.

MS Sql Script:

DECLARE @find varchar(8000)
SELECT @find='-' -- << Replace character
UPDATE [User]
SET [PhoneNumber]=Stuff([PhoneNumber], CharIndex(@find, [PhoneNumber]), Len(@find), ' ') -- << Replacement character

After applying the script the changes happen as in figure below:

User records after applying script
User records after applying script

 

Reference link: Is it possible to replace the first occurrence of a string in a column ?

 

Categories
Personal Productivity Quotes

Wisdom Thought Of The Day

Wisdom Thoughts
Wisdom Thoughts

By three methods we may learn wisdom:

First, by reflection, which is noblest;

Second, by imitation, which is easiest; and

Third, by experience, which is the bitterest.

empty image
Categories
.NET Personal Productivity Setup Utility

How to install .NET Framework 2.0 and 3.5 on Windows 8 in Offline Mode

I have installed Windows 8 few days back. And during some initial programs setup I noticed that Windows 8 does not include .NET 3.5 (include .NET 2.0 and 3.0) by default. However it did contained the setup in the OS disc.

So question is, How to install the .NET framework 3.5 including .NET 2.0 and 3.0 ?

Solution is answered as below.

I had found my solution on Microsoft support ? here.

This an Re-post of the same with corrections.

Steps below shows how we can install /enable the .NET Framework 3.5 (include .NET 2.0 and 3.0) feature in offline mode i.e. without using internet:

Step 1: Insert Windows 8 DVD or mount ISO image. The source of this feature can be found in folder E:\sources\sxs (In this case E: drive letter will be on which Windows 8 Media is located).

Windows 8 Media folder view
Windows 8 Media folder view

Step 2: Open cmd.exe (Command Prompt) with Administrative Privileges.

Step 3: Run the following command

dism.exe /online /enable-feature /featurename:NetFx3 /All /Source:"E:\sources\sxs" /LimitAccess

and then hit Enter.

Command Prompt showing installation of the feature.
Command Prompt shows installation of the feature completed.

 

Finish: After completing the installation of .NET Framework 3.5 you can see that the feature is enabled as shown in the screenshot below.

Windows features showing installed .NET 3.5
Windows features displays .NET 3.5 installed.

 

Categories
.NET ASP.NET C# HTML IIS Introduction JavaScript Setup SQL WCF Windows Azure Winforms WPF

Global Windows Azure Bootcamp at Ahmedabad 2013

This post is to share my experience with Global Windows Azure Boot camp event that happened in Ahmedabad.

About The Event

The event was about getting started with Windows Azure and Getting started with the Windows Azure Training Kit for any developers whether experienced or fresher and working on any programming platforms. The event was also about how real life applications can be benefited by using the power of cloud server and services.

WHAT IS WINDOWS AZURE ?

Windows Azure is Microsoft’s Cloud Platform which provides various hosting and architectural benefits along with scalability, reliability and which can scale the applications horizontal in very short time and minimum efforts. Windows Azure provides Cloud Hosting, Cloud Services, Cloud Mobile Services which enable Push notification to any platform (Really Any platform – iPhone, Android, Native application, Web applications) and many more features.

WHAT IS BOOT CAMP?

According to me, Boot camp is in other words Training Camp and in real life is much more fun. It’s an event where we, the developer, come with our tools and brains and collaborate to create and build in groups. In boot camp event people go to learn skills, usually skills involving physical or practical action rather than book subjects.

WHY IS IT GLOBAL WINDOWS AZURE EVENT?

It is because the event was happening at 90+ locations at the same time around the globe.

What was the Agenda of Event?

Start End Agenda Speaker
9:30 9:45 Registration
9:45 10:00 Welcome to GWAB!
10:00 10:45 Windows Azure – Complete Solution for Any Business Need Mahesh Devjibhai Dhola
10:45 11:00 Tea
11:00 12:00 Render Farm/Lab 1
12:00 13:00 Lab 2
13:00 14:00 Lunch/Networking
14:00 14:20 Windows Azure Real-life Application   Showcase Prabhjyot Singh Bakshi
14:20 15:00 Windows Azure for Mobiles Kaushal Bhavsar
15:00 16:00 Lab
16:00 16:15 Tea
16:15 16:45 Q&A/Giveaways
16:45 17:00 Thanks

How things went?

I think event was Awesome and I had learnt many things which I didn’t knew before. The Speakers removed the hesitation and fear of windows azure and cloud applications building that I had before the event. Event went good with the agenda and schedules although there were few examples and labs due to shortage of time, the speakers were nice and supportive to answer our questions and provided best guide they knew to clear the doubts. And they also helped in getting the Azure SDK that was +1 point to them. Initially Mahesh sir gave speech on the event agenda and introductions. Then went through the Windows Azure & its benefits, and applications that can be built with it. I must say event interactive session with him. He then introduced and made us familiar with the Windows Azure Portal to manage the sites. Then we went through the Render Lab deployment with some help. After lunch, Prabhjyot sir gave us some introduction about him and his team. He told about the cloud services and Windows 8 Application and some code examples built and already functional on the cloud. Then Kaushal Bhavsar showed us the Windows Azure Cloud Mobile Services and push notification services that Windows Azure provided using ‘Channel Url’ and that the push notification was available for use on any platform whether it is Web, native application, or mobile and on any Operating Platforms. Then some cool giveaways happened. My favorite was plural sight 1 year subscription but didn’t won it as there was only one of it but hey I got Cloud berry giveaway..

What was the cool thing about the event?

There are a couple of cool things,

  1. Alan Smith (@alansmith) who happens to be Microsoft MVP prepared something based upon his 256 worker role demo, if you want more in-depth info on the demo and the topic the check out read more from the blog post here.
  2. And we deployed the demo cloud application named renderlab on the windows azure ourselves through the labs with guidance and some efforts.
  3. Meet the Geeks – Mahesh Dhola, Jalpesh Vadgama, Kaushal Bhavsar, and Prabhjot Singh Bakshi.
  4. Meetup with other Ahmedabadi developers and learners.
  5. Lastly – Food, Giveaways (Gifts) and Windows Azure stickers.

HOW I CAME TO KNOW?

I came to know about Global Windows Azure Boot camp event going happening by Facebook post in AhmedabadDotnet Group. Go and Join the Group to get social with the Community on Facebook itself.

PS: Check the FAQ section of the event for more answers and information.

Here are few pictures from the event that I would like to share here,

Harsh Baid with Mahesh Dhola (on Right)
Harsh Baid accepting the Cloud Berry Giveaway from Mahesh Dhola (on Right)
Kaushal Bhavsar with Mahesh Dhola (on Left)
Kaushal Bhavsar accepting the Cloud Berry Giveaway from Mahesh Dhola (on Left)
Prabhjyot Singh Bakshi
Prabhjyot Singh Bakshi speaking at the event on Windows Azure Real-life Applications.
Mahesh Dhola
Mahesh Dhola speaking on Windows Azure – Complete Solution for Any Business Need.
Harsh Baid, Jalpesh Vadgama, Mahesh Dhola (left to right)
Group photo – Harsh Baid, Jalpesh Vadgama, and Mahesh Dhola (left to right)
Kaushal Bhavsar speaking on Windows Azure Cloud services
Kaushal Bhavsar speaking on Windows Azure Cloud services
The Great Handshake - Jalpesh sir and Mahesh sir (on right)
The Great Handshake – Jalpesh sir and Mahesh sir (on right) for Cloud berry giveaway

I hope you liked the post and event information. Share your experiences if you were also the part of the event Or May be some other event that you want to share with us.

 

Categories
Interview Questions SQL Utility

MSSQL – Change default database by sql query

Microsoft SQL Server Management Studio showing...
Microsoft SQL Server Management Studio showing a query, the results of the query, and the Object Explorer pane while connected to a SQL Server database engine instance. (Photo credit: Wikipedia)

Dear reader,

Recently I noticed in my daily work that every time I logged in MS SQL I was required to select the database which I had to work on and this was regularly in use by me and this lead me to find the solution to change the default database selection after I log on to MS SQL using SSMS to reduce the hassle and also so that I don’t execute queries on different databases by mistake.

There is an inbuilt stored procedure name sp_defaultdb which can be used as below

Exec sp_defaultdb @loginame='Domain/UserName', @defdb='MyDefaultDatabaseName'

Here value of parameter @loginname is User Name such as ‘sa’ and it can change depending on the MSSQL login configurations such as Sql Authentication or Windows Authentication. Example shown here is for Windows Authentication. Then value of parameter @defdb is the database name such as ‘master’ or ‘AdventureWorks’ and it will change as per the need to set the default database for the particular login specified.

But this stored procedure seems soon to be obsolete as mentioned in MSDN link here. There is newer option available for this purpose – ALTER LOGIN which has many other usability apart from setting the default database but I would stick to the topic and show its usage.

ALTER LOGIN [Domain\UserName] WITH DEFAULT_DATABASE = [MyDefaultDatabaseName]

I hope you found this helpful and learnt something new from this.

Reference links: StackOverflow – How can I change my default database in SQL Server without using MS SQL Server Management Studio?

Keep your comments flowing for what you prefer. 🙂

Categories
.NET ASP.NET C# Winforms

Getting started with Multifile assembly – Part II

Some brief before we continue

Hi! In the last article on this topic here MULTIFILE ASSEMBLY part – I, I had talked conceptually about creating multi-file assembly and possible usages.

In this post we will have more insights on the implementation part regarding multi-file assembly and using MEF to apply the concept practically in the applications using Directory Catalog technique.

Table Of Contents

  • History on multiple file assembly
  • What is MEF
  • General Architecture of Extensible Application
  • Implementing Windows Forms Application using MEF

History of multiple file assembly

To implement the multiple file assembly aka plugin application approach in past was very tedious work (I believe multiple file assembly is which uses more than one assemblies). Like in .NET application programs we had to use Reflection and Dynamic assembly loading and types tactics which were not reliable i.e. In case if any exception happens in the referencing assembly while loading into main program it would result in either a minor failure of a sub program or whole program leading to crash. However today we have a very good tool at hand from Microsoft, the name is Managed Extensibility Framework i.e. MEF in short name which I would be discussing in next few paragraphs.

What is MEF?

The answer is MEF is a composition layer or class library for .NET that improves the flexibility, maintainability and testability of applications of any size. MEF is used for third-party plugin extensibility, or it can bring the benefits of a loosely-coupled plugin-like architecture to our applications. It also lets extension or plugin developers easily encapsulate code and avoid fragile hard dependencies between the applications. In the next section we would be directly going to architecture overview and implementation information.

General Architecture of Extensible Applications

Sample Architecture Overview

Here there are three major components

  • Main Assembly
  • Infrastructure Assembly
  • Plugin Repository

Main Assembly

Main Assembly is comprised of UI and Wire Line or Skeletal code to combine the building block of the application. This defines the Features and Functional limits regarding extensibility of our application. Controlling the program flow and loading plugins from the repository such as from local directory or download from global repository and so on.

Infrastructure Assembly

In Infrastructure assembly, we have interfaces and abstract classes defined which stands for two purposes:

  • Define the basic skeleton of the plugins assemblies which are to be plugged in the main application.
  • Enables the loose-coupling and balanced cohesion between the main program and plugin assemblies.

We have to design and implement the Infrastructure assembly modules step before we start implementing the plugin modules, and design decisions are based on the features and extensibility of the application. It purely depends on the Infrastructure assembly that we do not have to recompile the main application assembly, in case of any changes to accommodate any new requirement or extensibility of the plugins into the Infrastructure assembly.

Plugin Repository

In Plugin Repository, we can have many different implementations based-on the Infrastructure assembly. Each and every plugin may or may not have all the types definition that we have in the Infrastructure design. The plugin repository can be online like Nuget Gallery and Atlassian JIRA or may be offline based on the needs of the application.

Implementing Windows Application using MEF

Sample Architecture Overview from Visual StudioHere we have one visual studio solution named “DynamicAssemblyApp” and four projects in that:

  • DynamicAssembly.Infrastructure – It is Infrastructure assembly.
  • DynamicAssemblyApp – It is Main assembly.
  • DynamicAssembly.FedEx – It is an Plugin assembly for FedEx specific shipping implementations.

DynamicAssembly.USPS – It is an Plugin assembly for USPS specific shipping implementations.

So how is this application loosely coupled and how plugins work in application ?

Here the layer diagram below shows the strong-coupling between the different assemblies. On closely inspecting we can observe that the Main Assembly aka DynamicAsssemblyApp does not have connector to any of the plugins we have created. We make it possible using the MEF to load the plugin assemblies at runtime into the infrastructure instance models in the main application’s memory.

Layer Diagram

How does Sample Main Application looks ?

Main Assembly

As we click the Load Assembly button the application would lookup the plugin directory and load the different shipping methods into the main assembly and List them in the ListBox control placed on left-hand side.

Please note currently in MEF approach there is no easy way to unload the plugins once we have them loaded into memory as mentioned in one of the www.StackOverflow.com question here.

To understand the dynamism happening in the main assembly, I would like to show it in some steps as below

  1. Define the Export or ExportMany in the plugin assembly on the class definition which inherits from IShipping type (Only those classes which inherits from Interface defined in Infrastruture assembly can be marked as Export, so application would know that where the plugin instance fits).
  2. Define the location to load the dynamic parts into our application, i.e. a public variable or property of the Interface type from the Infrastructure assembly. Here is is IShipping type.
  3. Define the trigger for loading the plugins such as
    • At the start up of main application in background thread so as to not slow down the startup time (recommended).
    • On click of a button or dropdown selection (shown in the example).
    • On File Directory changes with using some File System watcher.
  4. After the trigger check the variable or property having the imports, and use in the application appropriately as per the requirements.

Please note: Import/ImportMany or Export/ExportMany can be based on three different ways

  1. String Key i.e. [Export(“MyTypeKey”)].
  2. Type Definition such as Interface i.e. [Export(typeof(IInterface))].
  3. Both from above (recommended, As this will help to uniquely identify the Import happening in the main application and we can Import the target type in different forms from one plugin assembly and in less strict manner) i.e. [Export(“MyTypeKey”, typeof(IInterface))].

Defining Export in plugin based on the type.

/// 
/// Define the FedEx method for Shipping
/// 
// Export attribute here declares that the assembly is,
// ready to provide this class to external application to use
[Export(typeof(IShipping))]
public class FedExShipping : IShipping

We import the plugin instances for FedEx and USPS Shipping Methods in Property ShippingList in the main application and declaration is decorated with ImportMany attribute which would import and instantiate all the class types inheriting from IShipping interface from the plugin assemblies into the specified property.

// Defining the imports from the plugin directory.
// Using ImportMany as we would be loading all the assemblies,
// containing the Export for the specified interface type.
[ImportMany(typeof(IShipping))]
public List<IShipping> ShippingList { get; set; }

On click of the button ‘Load Assembly’ we trigger the loading of plugins assemblies from the plugin directory in the application directory. The code for this as below

/// 
// Clean up previous Shipping Methods.
lstboxShippingMethod.Items.Clear();

// Using the directory approach for pluging/loading the assemblies dynamically.
// DirectoryCatalog constructor takes the input filepath for the plugins
// Here it is in the application directory i.e. /bin/plugin/*.dll
var catalog = new DirectoryCatalog("plugin");

// Compose container using DirectoryCatalog instance
var container = new CompositionContainer(catalog);

// Finally load the plugins
// Here we might face exceptions in loading and exception information
// is usually in the InnerException of the Exception.
container.ComposeParts(this);

// If we found no Exports from the plugins for the Shipping Methods
// then return empty handed.
if (ShippingList == null) return;

// Iterate thru each of the shipping methods and add to the ListBox Collection
// PS: We could do many other sort of things with the Imported the Shipping List.
foreach (IShipping item in ShippingList)
{
	lstboxShippingMethod.Items.Add(item.ShippingName);
}

The NameSpace for ImportMany attribute and DirectoryCatalog are as below respectively,

using System.ComponentModel.Composition
using System.ComponentModel.Composition.Hosting

So getting in action,

  1. Rebuild the solution.
  2. Rebuilding solution will copy the FedEx assembly in the main application plugin directory automatically, as it is coded in the plugin’s Post-Build commands (see in Project’s Properties) to copy it there in the plugin directory.
  3. Execute the main application.
  4. Click the ‘Load Assembly’ button.
  5. FedEx would be listed in the ListBox.
  6. Now copy manually the USPS plugin assembly (/bin directory contents) into the plugin directory.
  7. One more time click the ‘Load Assembly’ button.
  8. This time FedEx and USPS both would be listed in the ListBox.

And we are done with sample!

Download the sample application from SkyDrive here.

I hope this was pretty good to know & understandable regarding plugin applications and MEF. At the point now I think that I would publish the MEF version of the HB Code application in future.

Do comment below regarding what you think on plugin applications and using MEF.

Keep reading and keep your thoughts coming to the world out.

Some Recommended articles and questions regarding MEF and plugin applications.

 

Categories
ASP.NET HTML Search Engine Optimization

How to enable press tab to search in Google Chrome and Mozilla Firefox on your website

Today, I learned something new while using StackOverflow in google chrome that it provides special area in browser’s address bar to search on the site even before you visit the site. I think this is very good feature as user can find the things very quickly on your site and get the expected output as soon as possible without having to see unnecessary details.

In image below you can see that I have enabled it for this site, it is visible in browser’s address bar and just below it you can compare it with the StackOverflow’s search in address bar.

Open Search on www.harshbaid.in
Open Search on www.harshbaid.in

 

Open Search on www.stackoverflow.com
Open Search on www.stackoverflow.com

You must be thinking that how to enable this for your own site or any other site that you are implementing, that is very easy task. You need to add OpenSearch XML on your site and link the OpenSearch XML document in html head section.

Example Usage

opensearch.xml

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    Example.com
    Example.com Search
    Search through Example.com

    UTF-8
    UTF-8
    false
    en-us
    open
    Example.com
    tag1,tag2

http://example.com/favicon.ico

Html link

Place the below html code inside <head> element section of the site.

opensearchdescription+xml" title="Example.com" href="http://www.example.com/opensearch.xml">

What is OpenSearch ?

And OpenSearch document consists of:

  1. OpenSearch Description files: XML files that identify and describe a search engine.
  2. OpenSearch Query Syntax: describe where to retrieve the search results
  3. OpenSearch RSS (in OpenSearch 1.0) or OpenSearch Response (in OpenSearch 1.1): format for providing open search results.
  4. OpenSearch Aggregators: Sites that can display OpenSearch results.
  5. OpenSearch “Auto-discovery” to signal the presence of a search plugin link to the user and the link embedded in the header of HTML pages

Find more about opensearch

Referenced From Stackoverflow

Enable pressing tab to search in google chrome on my website

 

Categories
.NET C# Entity Framework WPF

Understanding HB Code – Line of business application for WPF – Part I

 

HB Code – Line of business application for WPF

MVVM Architechture Overview

This project is made available as open-source and hosted freely on www.codeplex.com.

Prerequisites

  • Object-oriented programming using C#.NET and LINQ.
  • Nuget package usage.
  • Basic knowledge of WPF application building such as input controls, container controls, triggers, styles, templates.
  • Entity Framework, currently knowing any of versions of Entity Framework will work to check the working sample.
  • Sql Server 2005 database configuration and Sql queries.

Built

Technologies: .NET 4.0, WPF, Entity Framework 4.3 Code First,

Control toolkits: Avalon Dock, Avalon Dock MVVM, WPF Toolkit, WPF Extended toolkit, Microsoft Ribbon for WPF

Tools: Visual Studio Professional 2010, Sql Server 2005 Express, Entity Framework Power tools extension, Nuget Package Manager.

Please note: Current implementation is kept intentionally strongly typed to keep it easy to understand and reduce development time at initial stage.

Solution Projects Overview

  • HBCode Application (View)

This is the main entry point of the application. In this part, we have all the WPF and UI specific code implementations. It basically contains the WPF resources, WPF converters, Extended User Controls, Images, Application and Database Configurations, and Views (UserControls) used in the application.

  • HBCode Business Logic (Model)

This project contains all the business modules, business logic validation, and database connectivity, property change notifications implementations. Currently it uses Entity Framework 4.3 Code First with migrations to connect with the database. The Entity Framework 4.3 building blocks such as Database Context, Models, and Migration classes exist in this project.

  • HBCode Presentation (ViewModel)

This project contains the middle-tier ViewModel classes. View Model contains Collection of models, single models and sometimes aggregate properties for display purposes. The UserControls aka View are Databound to ViewModels containing model instances. ViewModels are built considering the UI layout and requirements. Such as if we consider a Sales billing UI will be containing Item list in grid and there will be one ComboBox column to display items to select from, so to Databound the Combobox we could either List<ItemModel> property in ViewModel at top-level or we can implement List<ItemModel> per row instance in List<ItemSaleModel> which would be bound to grid.

This project is made available as open-source and hosted freely on www.codeplex.com. You can download the source from www.hbcode.codeplex.com.

 

Categories
.NET ASP.NET C# Winforms WPF

Getting started with Multifile assembly

What is Multi-file assembly?

It is an application assembly either web-based or desktop-based which spans across many files to support extensibility and dynamically adding new features.

What is Modules?

Modules means class files such as Program.cs or frmMain.cs, in context of assemblies.

Usage of Multi-file assembly

  • Using different modules written in different .NET based programming languages such as C#.NET and VB.NET .
  • To optimize an application by putting less used types in a module that is loaded only as when needed or required i.e Lazy-loading assemblies.
  • Reduce application start-up by loading only required assemblies at start-up and then load less used assemblies in background thread or parallel Task-based threads.
  • Extend the application features by implementing plugin-based architecture, like we have in Orchard CMS and NopCommerce for web-based applications and in StockTrader application for desktop-based applications.
  • We can incrementally release application features or fix a bug & release a patch without completely recompiling the main assembly or application.
  • For multi-language applications releasing new languages support via custom language module packages.

Conceptual example of Multi-file assembly

For example, you have an e-commerce web application at hand which supports online booking goods & payments also, you currently have an account in PayPal so you create a main package containing Payment related interfaces and then reference it back to main application and in package which will be containing the actually concrete classes for PayPal implementation. And then plan and release new packages with more payment gateways such as Authorize.NET at later stage. This is a working example and implemented in NopCommerce web application.
PS: I will come with a demonstration application for building real plugin-based applications in my future posts.

Advantages of Multi-file assembly

  • Desktop Application with plug & play architectures are benefited.
  • Change of application behavior or add more services at later stage in spiral SDLC model.
  • More number of developers can work concurrently on larger projects independently on assigned modules.
  • Supports agile application development approach.
  • Complex projects can be built easily by Separation Of Concerns.

Disadvantages of Multi-file assembly

  • Increases development time as developers need to write without being aware of the main application and needs to communicate with various teams while integrating as a whole.
  • Small-scale projects do not get its benefit as it would increase cost of development and time both.

Detailed steps to create and use multi-file assemblies can be found at AspAlliance.com article here and you can download sample from AspAlliance.com MultifileAssembly.zip

I would like if you would share your thoughts on this topic with me.

Thanks.

 

Related Articles & links:

Importing multiple extension assemblies in C# with MEF
Building a Multifile Assembly on MSDN
Managed Extensibility Framework