Denaes Posted March 18, 2005 Posted March 18, 2005 I'm thinking of working with 2-3 libraries (.dlls). One for data, one for logic and then the application which displays. Now if I need to pass a class type with a specific interface from Data to Logic to Display, does it just matter that the signitures match up, or are the names fully needed. I'm not sure if in the Data library if I'd use a local interface or reach across to the application, which really reduces its portability and makes it dependant on the other library to run. They'll probobly have the same name, but be declared in three different places (and namespaces) but all have the same signitures (say FirstName(), LastName(), MiddleName() just for an example). Quote
Administrators PlausiblyDamp Posted March 18, 2005 Administrators Posted March 18, 2005 Just having the same method names is not enough - if you wish to work with a method that requires an interface you must implement the exact same interface, not one that just looks the same. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Denaes Posted March 18, 2005 Author Posted March 18, 2005 Public Interface iPersonName Property LastName() Property FirstName() Property MiddleName() End Inerface How about if I declared this in three seperate libraries? I declare it (same name, same signiture) in Display, Logic & Data. Each library uses their own declaration. a class implementing Display.iPersonName will be uncompatable with Data.iPersonName? So you have to build your libraries using exposed public interfaces and program specifically for Display.iPersonName for this to work? So my Data library would work with any other library so long as Display.iPersonName was exposed? Quote
Administrators PlausiblyDamp Posted March 18, 2005 Administrators Posted March 18, 2005 The interface would be part of a fully qualified namespace - if two libraries both declared an interface with the same name then the namespace would be used to identify each anyway, they would not pass for each other. If both libraries tried to declare the same namespace and interface combination then you would not be able to reference both from your application. Easiest solution is to put common interface in a shared library (possibly along with any general code that acts upon the interface) Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Denaes Posted March 18, 2005 Author Posted March 18, 2005 Thats a good idea. Just have a shared library of interfaces. Thanks :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.