Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Interfaces? 2

Status
Not open for further replies.

pererm

Programmer
Feb 11, 2002
27
ES
Hi. I´m looking around VisualStudio.NET, Visual C++.NET really, and i find out the concept "interface" like a new element of code inside on project. I think that this seem to be like a type of class that allow other classes use a way of relation each other, but really i don´t understand the real meaning of "interface". Can someone coment more axactly, which is their function inside the code? Thanks. PERE
 
I'm not sure about .NET, but in COM Interface class means a certain base class with virtual methods, which only are exported to external applications. Implementation part of these methods are internal classes derived from that interface class and unknown for external user.
 
Thanks mingis, only one thing more, i understand you can create a class derived of this internal inteface class, and add it to your project. It´s that right? Thanks, PERE
 
Yes, you can derive one of your classes from this interface just as you could derive it from any other class.
 
OK Thanks, timmay3141. It´s more useful for me. But if is possible can u tell me in what kind of situations is more indicated use an interface class instead a normal class. Thanks. PERE
 
Purpose of interfaces is distinguishing different realisations processing different things from common calling conventions to all these implementations. Let say, drivers of hard disk and diskette internally are different, but have common calling parameters (i/o buffer, tracks, heads, etc.) and common interface methods (read(), write(), ...).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top