Click here to Skip to main content
15,891,248 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionweb page popping out from iframe Pin
Hiren solanki20-Aug-10 4:06
Hiren solanki20-Aug-10 4:06 
AnswerRe: web page popping out from iframe Pin
R. Giskard Reventlov20-Aug-10 4:25
R. Giskard Reventlov20-Aug-10 4:25 
GeneralRe: web page popping out from iframe Pin
Hiren solanki20-Aug-10 16:57
Hiren solanki20-Aug-10 16:57 
GeneralRe: web page popping out from iframe Pin
Not Active20-Aug-10 17:19
mentorNot Active20-Aug-10 17:19 
GeneralRe: web page popping out from iframe Pin
Hiren solanki20-Aug-10 18:46
Hiren solanki20-Aug-10 18:46 
AnswerRe: web page popping out from iframe Pin
Eaverae22-Aug-10 20:51
Eaverae22-Aug-10 20:51 
QuestionInterface Pin
future383919-Aug-10 18:30
future383919-Aug-10 18:30 
AnswerRe: Interface PinPopular
Al-Farooque Shubho19-Aug-10 19:52
Al-Farooque Shubho19-Aug-10 19:52 
See, in real life, when you interact with some objects, you don't really care about the internal implementation or complexity of that object. For example, when you use your computer, all you care about is how to power on or off by switching the button, how to input data (Using keyboard or mouse) and as a user, you really don't care about how the computer is internally operating,taking your inputs and processing it to show output.

So, the computer has not exposed the internal complexities to you, or, to the outside world. All it provides is an "Interface" to the outside world with the information that the outside world needs to know to use and operate the computer. As a user, you are happy to know about the "Interface" only, rather then the Internal implementation and complexity (The "Class").

In the programming world also, when you need to develop a class (Which may do many complex things), you need to expose the capabilities and operation of the class to other applications or class libraries (That may use this class) so that they can understand and use your class accordingly. So, what you do is, you create an Interface that contains the method signatures and you implement those methods in your class. So, the client applications and libraries can develop their codes based upon the Interface you defined. While at runtime, the method invocation on the interface actually will turn out to method invocation in the implementation class.

Use of interface gives you extreme flexibility. For example, suppose you have an interface (IComputer) that exposes the functionality to the outside world and you have a class (WindowsPC) that implements the Interface method. Now, based upon some requirement, you can develop another class (MacPC) that implements the interface methods in a different way (Because, a MAC pc has the same kind of features, but, internally operates diffrently). Now, if the client application codes are developed based upon the Interface (And, not based upon the implementation classes), there is very little chance that, they would need to change their code. Why? Because, both of your implementation classes actually implements the same interface.

For example, WindowsPC and MacPC both implements the IComputer interface. So, if your client codes are developed using the IComputer interface and they accept the IComputer interface as parameters in their methods, you can send them an MacPC object, instead of the WindowsPC object any time and the client code will run perfectly without any problem (As long as your implementation classes are implemented correctly).

So, use of Interface gives you flexibility to your code that you can manage easily and you can extend it without much change.

Basically, use if interface is part of the basic Object Oriented Principles. You may take a look at this article How I explained OOD to my wife[^] to learn these principles.

Best of luck. Smile | :)

GeneralRe: Interface Pin
Ankur\m/19-Aug-10 20:10
professionalAnkur\m/19-Aug-10 20:10 
AnswerRe: Interface Pin
Ankur\m/19-Aug-10 19:55
professionalAnkur\m/19-Aug-10 19:55 
GeneralRe: Interface Pin
Al-Farooque Shubho19-Aug-10 20:41
Al-Farooque Shubho19-Aug-10 20:41 
GeneralRe: Interface Pin
Yusuf20-Aug-10 3:53
Yusuf20-Aug-10 3:53 
AnswerRe: Interface Pin
Eaverae23-Aug-10 0:49
Eaverae23-Aug-10 0:49 
QuestionUnable to connect to any of the specified MySQL hosts in asp.net2010 vista Pin
Piyush Vardhan Singh19-Aug-10 5:18
Piyush Vardhan Singh19-Aug-10 5:18 
AnswerRe: Unable to connect to any of the specified MySQL hosts in asp.net2010 vista Pin
Yusuf19-Aug-10 10:27
Yusuf19-Aug-10 10:27 
Questionimage display problem Pin
Dhyanga19-Aug-10 4:41
Dhyanga19-Aug-10 4:41 
AnswerRe: image display problem PinPopular
Al-Farooque Shubho19-Aug-10 5:41
Al-Farooque Shubho19-Aug-10 5:41 
GeneralRe: image display problem Pin
Dhyanga19-Aug-10 6:04
Dhyanga19-Aug-10 6:04 
QuestionReading data from ListView into generic list Pin
kstxx19-Aug-10 2:20
kstxx19-Aug-10 2:20 
Questionkey press in asp:TextBox Pin
dittu718-Aug-10 22:20
dittu718-Aug-10 22:20 
AnswerRe: key press in asp:TextBox Pin
Blue_Boy19-Aug-10 0:26
Blue_Boy19-Aug-10 0:26 
QuestionStatic method Pin
future383918-Aug-10 19:34
future383918-Aug-10 19:34 
AnswerRe: Static method Pin
Rajendra Prasad Panchati18-Aug-10 20:54
Rajendra Prasad Panchati18-Aug-10 20:54 
AnswerRe: Static method Pin
R. Giskard Reventlov18-Aug-10 21:25
R. Giskard Reventlov18-Aug-10 21:25 
AnswerRe: Static method Pin
Arun Jacob18-Aug-10 22:05
Arun Jacob18-Aug-10 22:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.