all groups > dotnet academic > january 2005 >
You're in the

dotnet academic

group:

.NET Framework Class Library Design Question - ISite, IComponent, IContainer


.NET Framework Class Library Design Question - ISite, IComponent, IContainer jamal NO[at]SPAM docUSA.com
1/7/2005 9:48:14 AM
dotnet academic:
I have copied the associated interfaces from MSDN below. The problem is that
I do not completely understand why it is designed in that way? What is ISite
for and is it really useful? And finally does anybody know new enhancements
in this design on Whidbey?

Copied from MSDN for your convenience:
public interface ISite : IServiceProvider
{
IComponent Component {get;}
IContainer Container {get;}
bool DesignMode {get;}
string Name {get; set;}
}

public interface IComponent : IDisposable
{
ISite Site {get; set;}
event EventHandler Disposed;
}

public interface IContainer : IDisposable
{
ComponentCollection Components {get;}

void Add( IComponent component );
void Add( IComponent component, string name );
void Remove( IComponent component );
}

Re: .NET Framework Class Library Design Question - ISite, IComponent, IContainer B S Wootton
1/31/2005 2:15:08 AM

[quoted text, click to view]

I think the point is just that communication between Components and
Containers is decoupled. Containers can for instance do some of their work
via a consistent ISite interface. MSDN also describes them as a place to
store container-specific per component information, such as the component
name. This, and the design time flag seems to be the only purpose of the
example code.

You're right that it does seem complex. I'm sure designers will get an
overhaul in Whidbey.

Ben

AddThis Social Bookmark Button