Click here to Skip to main content
15,881,898 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to create a library project which acts as a sort of wrapper/intermediary class and has all my variables/functions to be used in other classes. Is there any efficiency in creating an interface within this library to store variables or that can easily just be declared in the library class itself?
Posted
Updated 8-Oct-15 21:55pm
v2
Comments
Philippe Mori 9-Oct-15 12:53pm    
You probably don't want to do that. This is not good design. Better to learn software development first...

Quote:
I want to create a library project which acts as a sort of wrapper/intermediary class and has all my variables/functions to be used in other classes
Why? Have you a specific requirement (e.g. you need a proxy) or do you see a general advantage in doing that?



Quote:
Is there any efficiency in creating an interface within this library to store variables or that can easily just be declared in the library class itself?
You know, there is no performance gain in using iterfaces. Interface has a very specific role in Object Oriented Programming, if you have any doubt then I suggest you studying a good OOP book (or, at least, read goodtutorials on the web).
 
Share this answer
 
Interfaces can't store anything, you'll still need the properties to be stored in a concrete class. Interfaces are only of use if you can see you needing different concrete implementations of the class that stores your properties. As we're talking data here, that's very unlikely, you normally use interfaces so you can have different implementations of code, however properties are properties. So I wouldn't bother with an interface.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900