Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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).

Posted

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?

  • Administrators
Posted

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)

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...