Dot Net Stuff

Understanding Loose Coupling and Tight Coupling

As the name suggesting loose coupling means reducing dependencies of a class that use a different class directly. Loose coupling promotes greater reusability, easier maintainability. On the other hand tight coupling, classes and objects are dependent on one another. I must say that, tight coupling is usually bad because it reduces flexibility and re-usability of code and we are not able to achieve complete object originated programming features.

What is Tight Coupling:-

As par above definition a Tightly Coupled Object is an object that needs to know about other objects and are usually highly dependent on each other's interfaces. When we change one object in a tightly coupled application often it requires changes to a number of other objects. There is no problem in a small application we can easily identify the change. But in the case of a large applications these inter-dependencies are not always known by every consumer or other developers or there is many chance of future changes. Continue Reading>>

ASP.NET MVC Overview

MVC is acronym of Model – View – Controller, is a software design pattern, which divide software application in to three major interconnected parts.

  1. Model- It is a class which is used to show or update view by using business logic. It is also used to validate user input. e.g. Employee, Student, etc. 
  2. View – It is responsible to interact with users, it is the component that display the application to users. E.g. Textbox, Checkbox, etc. 
  3. Controller- It is responsible to accept the request from the view, works with the model and select the view to render to display the User Interface (UI).Continue Reading>>

Features of ASP.NET MVC

The ASP.NET MVC framework provides an alternative to the ASP.NET Web Forms pattern for creating MVC-based Web applications. The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as membership-based authentication and master pages. The MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace.Continue Reading>>

Understanding HTML Helpers in ASP.NET MVC Framework.

One of the most important purpose of server controls in ASP.NET —favoring HTMLlevel code reuse. ASP.NET MVC doesn’t have the server controls but it have. To achieve these features in MVC, It needs be built programmatically based on dynamically discovered data. What’s a technology equivalent to server? controls in ASP.NET MVC? Here comes the sense of HTML helpers.

HTML helpers certainly are not the same as server controls, but they are the closest you can get to HTML-level code reuse with a view engine. An HTML helper method has no view state, no postbacks, and no page life cycle and events. HTML helpers are simple HTML factories. Technically, an HTML helper is an extension method defined on a system class—the HtmlHelper class—that outputs an HTML string based on the provided input data. Internally, in fact, an HTML helper simply accumulates text into a StringBuilder object.


HTML helpers can be classified into three categories.Continue Reading>>