Crystal Space
Welcome, Guest. Please login or register.
October 17, 2017, 07:26:19 pm

Login with username, password and session length
Search:     Advanced search
9063 Posts in 2051 Topics by 77031 Members
Latest Member: Zenguachase151
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  What is the real meaning of 'interface' in CS?
« previous next »
Pages: [1] Print
Author Topic: What is the real meaning of 'interface' in CS?  (Read 3125 times)
Jr. Member
Posts: 81

View Profile Email
« on: October 14, 2007, 04:59:41 am »

    I am very in CS. For a long time i am confused with the meaning of 'interface' in CS. Is it a visual class ? Or it has the same meaning of 'interface' in Java?   
     can you tell me the real meaning of 'interface' in CS?  Thank you very much!
Hero Member
Posts: 1706

View Profile
« Reply #1 on: October 14, 2007, 05:50:59 am »

An interface has both a conceptual meaning and (in Crystal Space) a technical meaning. On a conceptual level an interface represents a contract between two parties. It defines how one party (for example an application using CS) can use functionality in another party (for example a plugin in CS). The interface is the only way to use the functionality in that plugin. The set of interfaces included with CS form the API of CS and define how you can use CS.

On a technical level an interface is represented by a pure virtual abstract class in C++. That means a class where every function is declared as pure virtual (like 'virtual void Function () = 0'). This means you can only see the declaration of that class but not the implementation. The implementation is private to the plugin and you're not supposed to know what it is (black box model).

And yes, interfaces in java are similar. The big difference is that Java has a language construct to define interfaces and in C++ we have to simulate it using pure virtual abstract classes.

Hope this helps,

Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 4.132 seconds with 15 queries.