Wednesday 30 January 2013

Mixing ASP.NET webforms and ASP.NET MVC


In early years, I mean, before Microsoft release ASP.NET MVC framework, all of our applications has built in ASP.NET webforms. 

After ASP.NET MVC arrives and we start tasting(using) the framework then everyone start building and migrating existing applications into ASP.NET MVC as ASP.NET MVC giving more flexible options than webforms.

So for example, all rooms (say each room is our application) in our house are built in ASP.NET webforms.  We can destroy the whole house and re build from scratch using ASP.NET MVC.

But in the business perspective, we cannot do that as many of our systems may be making money and depends upon other factors such as internal and external systems may be interconnected and using same resources…etc.

So we need renovate or rebuild our rooms one by one and find the alternative place to stay within our house without vacating from existing house until rebuild or renovate the whole house.

You may be think, why do we need such a story here and should not come to the relevant problems straightway to talk about?

That is good question. Because this story may be make you think more in different angles and we never forget any concept when we talk about with some real time stories.

Let’s say we renovated some of the rooms using ASP.NET MVC and we need to share the resources all across the rooms until rebuild/renovate the whole house.

I mean technically, how we can reuse the many features and resources among the two applications.
Particularly, session, cookies, HTTPContext and server objects…etc.

Before getting into this topic further deep, I have Bing and Google it and found the very interesting article on http://www.packtpub.com/article/mixing-asp.net-webforms-and-asp.net-mvc?page=1&signup=false

 What are the key considerations when mixing ASP.NET webforms into ASP.NET MVC?
  1. We can either mix ASP.NET MVC into ASP.NET webforms or ASP.NET web forms into ASP.NET MVC.  Mixing ASP.NET webforms into ASP.NET MVC is less overhead and its depends upon your complexity of your ASP.NET webforms or ASP.NET MVC applications. Some cases reverse should be less overhead.
  2. We need to add/modify Global.asax.cs if your ASP.NET application has events on that.
  3. We need to add/remove few configuration settings & assemblies,  3rd party(if you using it in your ASP.NET webforms application)  assemblies settings into Web.config
  4. We may need to add/modify changes in some of the code behind files in order to build with your current .NET framework. I don’t think so you need do many changes apart from this.
The above solution will work until we renovate or rebuild the whole house without vacating the house.

Please feel free to share your views/thoughts and contact me if you have any questions.

Thanks for reading.

Solution Architect


In this section, I am going to write about the real scenarios which we may come across and how we can do the solution architect for solving the problems. I think this kind of topics will help others to architect and build their systems.

Note:  Please note that applying these solutions depends upon how your applications been build, situations & other factors.

Topics:
  1. Mixing ASP.NET webforms and ASP.NET MVC
more topics are will be coming soon. Please check back.

Saturday 12 January 2013

Other technologies which is not in the above


Sorry. This page is under construction. Please check back soon.

Android


Sorry. This page is under construction. Please check back soon.

BizTalk Server


Sorry. This page is under construction. Please check back soon.

SharePoint


Sorry. This page is under construction. Please check back soon.

What offers the recent versions of source versions controls systems such TFS, TortoiseSVN…etc. for you


Sorry. This page is under construction. Please check back soon.

Windows Azure


Sorry. This page is under construction. Please check back soon.

Windows 8 Apps


Sorry. This page is under construction. Please check back soon.

jQuery


Sorry. This page is under construction. Please check back soon.

HTML 5 /CSS 3


Sorry. This page is under construction. Please check back soon.

Microsoft Business Intelligence Stack (SSIS, SSRS, SSAS)


Sorry. This page is under construction. Please check back soon.

What offers the recent versions of .NET technologies such as C#, ASP.NET MVC, WCF, WWF, WPF, Silverlight, LINQ, Entity Framework, OData Services, ASP.NET Web API…etc. for you


What offers the recent versions of .NET technologies such as C#, ASP.NET MVC, WCF, WWF, WPF, Silverlight, LINQ, Entity Framework, OData Services, ASP.NET Web API…etc. for you

The some of the features of the Microsoft .NET recent versions 4 and 4.5 are given below.

1. Please note that each and every version of Microsoft .NET release tight, improve the security model and performance in various areas.

2. Microsoft .NET framework 4 introduces a new programming model called Parallel Computing for writing multithreaded and asynchronous code that greatly simplifies the work of application and library developers. This model enables developers to write efficient, fine-grained, and scalable parallel code in a natural idiom without having to work directly with threads or the thread pool. The new System.Threading.Tasks namespace and other related types support this new model. Parallel LINQ (PLINQ), which is a parallel implementation of LINQ to Objects.
Please visit below URL’s to know more about parallel programming.

3. In ASP.NET MVC, many features such as new Razor view engine, HTML 5 & Mobile supported templates, powerful hooks with Dependency Injection & Global Action Filters, OData Services, ASP.NET Web API, Asynchronous methods etc.
References:

4. The named, optional parameters enabled the developers that don’t need to pass the common values in method calls.
Please visit the below URL’s to know more about the details

5. The Covariance and Contravariance in Generics.
In Covariance, Object=string.
In Contravariance, string=Object.
For example, In Covariance èClass Y: X then we can assign X = Y.
In Contravariance èClass Y: X then we can assign Y = X.
Please visit the below URL’s to know more details about Covariance & Contravariance

6. Dynamic Language Runtime:  DLR makes it easier to develop dynamic languages like LISP, JavaScript, PHP, and Ruby to run on .NET framework and add dynamic features to statically typed languages.  Dynamic is behaves like type Object in most circumstances and resolved at runtime.
References:

7. The special feature called Asynchronous Programming with Async and Wait. This feature helps to avoid the performance bottlenecks & improve the responsiveness.
References:

8. Many features are improved and added in WCF, WPF, and WWF & AJAX library.

9. Tuple:  A Tuple has many items and each item can contains any type.   For example,
Tuple<int, string, string, bool> accountDetails = new Tuple<int, string, string, bool> (2345,
"ANZ Bank", “City”, true);   
Reference:

Note:
If you would like to find the version of Microsoft .NET installed on your machine then use either
  1. Open windows explorer and type %windir%\Microsoft.NET\Framework\
  2. Go to command prompt and type wmic product where "name like 'Microsoft .NET Framework%'" get name,version  and press enter
  3. Type regedit in RUN or Start Menu search box and press enter and then navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP
References:

Microsoft PowerShell


Microsoft PowerShell:

Microsoft PowerShell is power for everything. Microsoft PowerShell is a task based command line shell & scripting language and offers many things for you.
  1. Its offers you the all equivalent command or task which UNIX commands does.  We can say Microsoft PowerShell is windows scripting language.
  2. Special PowerShell commands are available for Visual Studio, IIS, and AppFabric caching, SQL Server…etc.
  3. You can create the deployment scripts using Microsoft PowerShell and special PowerShell commands are available for this.
  4. Please type get-command and press enter key on Windows PowerShell command prompt then it will give you all the command names and definition.
  5. Please type get-help  “command name” and press enter key and will display the help for that command. For example,  get-help grep
  6. You can use it for automated build process.
  7. Special PowerShell commands are available for Network and DBA administrators.
  8. You can use PowerShell for Workflow tasks.
  9. Special PowerShell commands are available for Windows Azure.
Please try to use Microsoft PowerShell and you will say PowerShell is more powerful.

Please visit Microsoft site to know more about PowerShell and usage.

References: