468,512 Members | 971 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

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

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
1 3137
weaknessforcats
9,207 Expert Mod 8TB
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.

Similar topics

1 post views Thread by Chris Fink | last post: by
1 post views Thread by Husam | last post: by
4 posts views Thread by IchBin | last post: by
18 posts views Thread by chankl | last post: by
21 posts views Thread by Jonathan Sachs | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.