When a user logs into a business application, they rarely think about what went into the design, or how it works. They are only interested that it allows them to do their job, simply, efficiently and trouble free.
The business application designer, on the other hand, is very concerned about how it works. Is it secure? Is it scalable? Does it have good performance? And many other question, the most important of which is, does it meet the needs of the user?
Web based business applications in the past weren’t always very secure, and changes and implementation were often difficult. And the ability to run on different devices was almost impossible, often resulting in one site being designed for tablets and smart phones, while another was designed for desktop users. It was frustrating.
Today we have the introduction of different frameworks that solve many of the problems of the past. The Bootstrap framework gives a designer the ability to design an application that will conform to any device, without having to design one application for a smartphone and another for the desktop. It goes further. It provides a standard, giving the site a specific look and feel to the user, and is completely customizable. This has been a great step forward in delivering an elegant looking, full featured site to the user.
The MVC framework, which stands for Model, View and Controller, divides a business application into three separate parts. Each part is responsible for a different function of the application. The Model is responsible for defining and interacting with the database, making sure that information coming in from a user conforms to specific standards. It reduces the impact of the garbage-in, garbage-out problem because it can be highly structured independent of programs that utilize the data. In other words, it is a bulwark against “bad data” if properly designed.
The View is responsible for delivering a web application page to the user. Its focus is providing the user with the look and feel, as well as the ability to navigate through the site. Since it is decoupled from the Model and Controller, the experienced designer can make full use of breaking the View down into reusable components that can be linked together dynamically when a user requests a specific page. By that, I mean that the navigation can be separate piece that is used by numerous pages, the footer can be another, and on and on. Forms and tables can be given intelligence, the ability to communicate with the server. You’ve seen this many times. When you begin typing a Google search a list of possible search queries is presented with each stroke. That is because the View is communicating with the server to provide this information in real time – the View can be interactive and intelligent.
The Controller is responsible for directing traffic and delivering the right information. You, as a user, enter a URL in the browser of your computer or smartphone. That URL is sent over the Internet and finds its way to the Controller, which examines your “request” and determines what data is required via the Model and then sends that data to the View, which in turn sends a “response” out over the Internet and back to your computer. All of this is done in the blink of an eye. The Controller is the first line of defense for security and since it has great responsibility, processing requests and delivering responses to you, the user, it must be designed to be very efficient, reliable – and secure.
The Microsoft ASP.NET MVC framework was conceived in December of 2007. It wasn’t mature until version 5.0, which was June of 2013. Just last year, 2016, MVC Core was introduced that allows a web application to be compiled for various operating systems, Linux, iOS, Android, and of course Windows.
However, these things are not the “new framework” that I thought about when I began writing this article. They are recent and fairly new. They are something you need to understand since they serve as a foundation for the “new” framework that I am going to discuss.
The new framework has to do with the way in which the Controller is designed. The Microsoft MVC business application is written in the C# programming language. Unlike PHP, it is compiled, translated into machine code, which can be much faster and more secure than a scripted application. If a hacker (or disgruntled employee) gains access to your server and steals your old uncompiled application, they know exactly how your business works and where it is vulnerable. They cannot do that with a compiled application because all they will get is an executable and won’t have access to your business processes. And if the system is designed right, won’t even be able to access your data. That’s a pretty important difference, don’t you think?
The real power of the new framework and C# programming language is that you can build something called a “class”. A class is an object that you can create to perform a certain task. For example if I create a class called GetContactInfo(contactID), all I have to do is make a request to that class by supplying an ID and it returns all of the information I need for a contact. Now, if a request of this nature is needed in a dozen different places by the business application, the class doesn’t have to be created by the programmer each and every time. It is created once and used many times.
What has this got to do with the Controller? It allows the system designer to build a Controller that has very few lines of code because it is retrieving what it needs from these class objects that are talking to the Model and doing all of the processing. It makes debugging easier because a problem can be isolated, and when it is fixed in one place it is fixed everywhere that class object is called. Easier to maintain and more bullet proof. It also means greater productivity, less cost and quicker turn around times.
The bottom line is that business applications can now take advantage of new technologies and the business entrepreneur can focus on innovation and process improvement with faster turn around times.