By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,831 Members | 1,031 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,831 IT Pros & Developers. It's quick & easy.

Advantages and Disadvantages of exposing interfaces through Opaque data types in C

P: 1
Hello,

I am trying to figure out the advantages and disadvantages of exposing interfaces through Opaque data types in C. I have figured/found out the following two advantages

1. Higher level of abstraction
2. if the layout of the defined structure inside the source files changes, it will reduce/limit/minimize the amount of changes that may be needed in the code of the application that uses the library i.e. the library will itself handle the effect of the changes by enhancing the existing function definitions and possible exposing more interfaces.

Could you suggest some more advantages in this regard?

Just for your reference, I am including the following link that show how to expose an interface through opaque data types.
http://c-faq.com/struct/opaque.examp.html

Thanks in advance.

Regards,
Naveen
Feb 6 '08 #1
Share this Question
Share on Google+
1 Reply


weaknessforcats
Expert Mod 5K+
P: 9,197
Just get a book on C++ and read up on the advantages of:

encapsulation
data hiding
polymorphism
separating interface from implementation
design patterns
etc...
Feb 6 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.