Click here to Skip to main content
15,906,766 members
Home / Discussions / C#
   

C#

 
GeneralRe: implementing interface not in same dir as class Pin
zuhx5-Jun-03 19:56
zuhx5-Jun-03 19:56 
GeneralRe: implementing interface not in same dir as class Pin
shaunAustin5-Jun-03 21:56
shaunAustin5-Jun-03 21:56 
GeneralRe: implementing interface not in same dir as class Pin
zuhx6-Jun-03 5:57
zuhx6-Jun-03 5:57 
GeneralRe: implementing interface not in same dir as class Pin
shaunAustin6-Jun-03 9:05
shaunAustin6-Jun-03 9:05 
GeneralRe: implementing interface not in same dir as class Pin
zuhx6-Jun-03 11:00
zuhx6-Jun-03 11:00 
GeneralRe: implementing interface not in same dir as class Pin
shaunAustin6-Jun-03 12:06
shaunAustin6-Jun-03 12:06 
GeneralRe: implementing interface not in same dir as class Pin
zuhx8-Jun-03 19:31
zuhx8-Jun-03 19:31 
GeneralRe: implementing interface not in same dir as class Pin
shaunAustin9-Jun-03 8:34
shaunAustin9-Jun-03 8:34 
No Probs... Big Grin | :-D

In terms of Interfaces and namespaces I'll try to explain...

Just because you put a bunch of types in different assemblies into the same namespaces doesn't mean that those types are merged together into one namespace.

When you add a reference to another assembly or project the namespaces of that assembly of project becomes accessible to the exe or dll making the reference. The thing is, if you're typing code and using intellisense the IDE merges the namespaces for you but if you look in object browser I don't think they are. Basically the key to accessing code in another assembly is in the references not the namespaces. (That probably makes no sense at all WTF | :WTF: )

As far as the separate dll for Interfaces I'll try to chuck some words down...

There are two reasons: one is architectural good practice, the other is a physical considerations.

Architectural- Good code design dicatates separating 'interface' from 'implementation' everywhere possible, from 'GUI' and 'Business code', to 'class definitions' and 'implementation'... With interfaces (as in public interface foo{}) you might specify a bunch of them for your application and insist that any part of the system that uses other parts of the system do so using interfaces. The advantage of this is that you can make your code modular and extensible without much effort.

For example you could have a text editor which has a bunch of import filters which all have to support ITextFilter... in future you might want to add new ones which is no problem so long as the new filters support ITextFilter.

Physical- the physical reasons are to do with the old references. If you have a set of assemblies with intefaces and code together then you want to create new code that implements those interfaces too (say on a remote machine for example) you would have to copy all of the dlls with code onto the other machine in order to provide the inteface definition. This is BAD... the best way is to have a small assembly which defines interfaces and have clients and servers reference that. It's also a convenient place to store them too for maintenence.

The other limitation in your case was that your interface was defined in your exe which under .NET is a bit of a no-no, as project references only work with .dll type assemblies.

Sorry if that was patronising (or wrong Big Grin | :-D ) I was kinda in the zone!!

Shaun
GeneralRe: implementing interface not in same dir as class Pin
zuhx11-Jun-03 4:21
zuhx11-Jun-03 4:21 
GeneralRe: implementing interface not in same dir as class Pin
Kant6-Jun-03 16:34
Kant6-Jun-03 16:34 
GeneralRe: implementing interface not in same dir as class Pin
shaunAustin7-Jun-03 0:49
shaunAustin7-Jun-03 0:49 
GeneralRe: implementing interface not in same dir as class Pin
Kant7-Jun-03 4:42
Kant7-Jun-03 4:42 
GeneralRe: implementing interface not in same dir as class Pin
shaunAustin8-Jun-03 21:50
shaunAustin8-Jun-03 21:50 
GeneralRe: implementing interface not in same dir as class Pin
Kant9-Jun-03 12:13
Kant9-Jun-03 12:13 
GeneralRe: implementing interface not in same dir as class Pin
shaunAustin9-Jun-03 12:53
shaunAustin9-Jun-03 12:53 
GeneralRe: implementing interface not in same dir as class Pin
Kant9-Jun-03 15:34
Kant9-Jun-03 15:34 
GeneralRe: implementing interface not in same dir as class Pin
Kant7-Jun-03 5:17
Kant7-Jun-03 5:17 
GeneralObject events through the ide Pin
RB@Emphasys5-Jun-03 8:53
RB@Emphasys5-Jun-03 8:53 
GeneralRe: Object events through the ide Pin
Paresh Gheewala5-Jun-03 9:35
Paresh Gheewala5-Jun-03 9:35 
GeneralRe: Object events through the ide Pin
RB@Emphasys5-Jun-03 9:48
RB@Emphasys5-Jun-03 9:48 
GeneralMaster-Detail datagrid Pin
Madhuri Mittal5-Jun-03 6:38
Madhuri Mittal5-Jun-03 6:38 
GeneralRe: Master-Detail datagrid Pin
Paresh Gheewala5-Jun-03 9:19
Paresh Gheewala5-Jun-03 9:19 
GeneralHosting an IE window in a form Pin
eggie55-Jun-03 4:54
eggie55-Jun-03 4:54 
GeneralRe: Hosting an IE window in a form Pin
dynamic5-Jun-03 5:15
dynamic5-Jun-03 5:15 
GeneralRe: Hosting an IE window in a form Pin
eggie55-Jun-03 10:40
eggie55-Jun-03 10:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.