Login for your services
Digital Diary My Tasks Bookmarks My Q/As
AXARROW HIGHLIGHTS
When we develop enterprise level /large commercial application, there are dozens of technical aspects that we explore, select, implement and ensure their smooth coming along, as per their integration and best fitment in a large setup. This article discusses some of the technical aspects in Developing Enterprise Level Commercial Application Using ASP.NET MVC framework.
Recent Articles
VIEW ARTICLE

Developing Enterprise Level Commercial Application Using ASP.NET MVC

Author: Anant Kumar
Category: Programming
Submitted On: 8/9/2017
Published On: 8/9/2017
ABSTRACT: When we develop enterprise level /large commercial application, there are dozens of technical aspects that we explore, select, implement and ensure their smooth coming along, as per their integration and best fitment in a large setup. This article discusses some of the technical aspects in Developing Enterprise Level Commercial Application Using ASP.NET MVC framework.

Developing Enterprise Level Commercial Application Using ASP.NET MVC Framework

As we highlighted few techical aspects with respect to architecture of a large scale enterprise level application in one of our articles ( Writing Enterprise Level Commercial Applications ), in this article we attempt to specify certain practical aspects when you actually start building the application structure in Visual Studio.
It is assumed that you have already worked upon the technical architecture of the application, defined and finalized business requirements, data structures, business work-flow, information exchange setups, use-cases, test cases,final inputs patterns and desired output scenarios.

In the following paragraphs, we will be discussing about the program setup in Microsoft Visual Studio using ASP.NET and MVC framework. ASP.NET is an object-oriented, server-side framework, written in the C# programming language and the VB.NET programming language. It is designed by Microsoft to develop websites and applications specifically on Internet browsers and server systems, and is a colossal infrastructure that requires a good amount of knowledge and expertise to work within. .NET simplifies building of websites and web applications by giving developers libraries of code and tools, all in one package.

With the induction of advanced application UI frameworks like Bootstrap, JQuery, AngularJS etc. along with C# service side .NET framework, it has now become considerably easier and faster to develop fully responsive applications that adapt to user screen sizes. Developers now can render beautiful UI components as per user device screen size and provide the user with great User experience.

Application Program Setup

Program Modules Setup
A typical commercial program has multiple modules like: -
  • Administration Module
  • Main Home Control Module
  • Sub-module e.g. Showroom Section
  • Sub-Module e.g. Billing Section
  • Sub-Module e.g. Store Section
  • Any other module...
Based on the main architecture of the program, entire program setup is divided into multiple modules each with its own responsibilities of carrying out specific set of tasks. Each module is created and given a set of duties and powers. Modules have internal functionality, input interfaces, output interfaces, protocols for information exchange, information security setup etc. These modules are designed in such a way that they can be easily re-used in multiple program requirements and can be of plug-n-play pattern.

Visual Studio .NET framework provides us an easy way to divide a large program into smaller modules in terms of "Areas". It is simple to add an "Area" to the main program.

Right-Click on the Project folder and Select "Add" >> "Area". Write the "Name" of the Area. This Area Name should indicate the Module name in the bigger setup. The Studio shall add all basic /required sub-folder under the main project folder /Areas/.

This Area shall create a full-fledged working sub-set based on MVC framework. It has it's own configuration file, own set of Controllers, Models and View folders. That means it is an independent sub-unit of the main program. But at the same time, it has the access to components residing in the parent module.

Area Configuration
Under the main program /project folder, the Visual Studio creates /Areas/Module-Name sub-folder, with replica of main folder setup, including Controllers, Models, Views -> /Shared/_Layout.cshtml. This actually allows us to work on independent modules.

Views /Menu Items:Every module can have its own UI components file as it has own _Layout.cshtml. Whenever you shift the control to specified "Area", the related Menu items get loaded. It depends upon the requirements as how you want to get the items displayed /rendered to UI screen.

Controllers:The controllers keep themselves within the namespace of the main program like

namespace MAINPROGRAM-NAME.Areas.MODULE-NAME.Controllers
{
    public class DepartmentsController : Controller
    {
           ...code
    }
}   
So they do not interfere with methods being written in controllers of other Areas.

Models:Each module shall have its own entity framework model setup. In the database-first kind of setup, you may fetch database schema from the database source by applying Update-from-database menu command. But one thing is worth pointing out here is that whenever you have any table(s) that exist in other module/Area as well, you need to pre-fix such table-schema with some words that make this table name distinct across the entire program areas.

Control Flow
When there are multiple modules /Areas in yooour program, you set the starting View by defining it in the "_ViewStart.cshtml" file as below: -

   @{
    Layout = "~/Views/Shared/_Layout.cshtml";
   }

And within the "_Layout.cshtml" file, you have the choice to redirect the control to any of your method residing in any of the Area /module, like: -

@Html.ActionLink("Menu-Text", "Method", "Controller", 
      new { area = "Module-Name" }, 
      htmlAttributes: 
      new { id = "SomeValue", @style="color:white"})
                


Method Call Across Controllers
If you have some common method(s) defined in some other Controller and you need to invoke it. Simply, make an instance of the Controller and invoke the method.

   ...
   ...
    resultTypeVariable = await new MyTargetController().InsertValues(val1, val2, ...);
                


In summary, the major task that we perform while building large applications with ASP.NET MVC framework is that we separate program into Areas and shift program control in desired Area / method at run-time as per requirements.

Go to Top
Developing Enterprise Level Commercial Application Using ASP.NET MVC

Related Questions...(0) Ask A Question

Ask a Question

Go to Top