some text concerning components

T

Tony Johansson

Hello!

Below is some text that I don't figure out what they are trying to say.
What I do know is that a component in .NET is a DLL either without user
representation or with user representation.
Maybe someone could tell me what they are trying to say.

1. Programming with components
A software component is a system element offering a predefined service and
able to
communicate with other components. Clemens Szyperski and David Messerschmitt
give the
following five criteria for what a software component shall be to fulfil the
definition:
.. Multiple-use
.. Non-context-specific
.. Composable with other components
.. Encapsulated i.e., non-investigable through its interfaces
.. A unit of independent deployment and versioning.

Software components often take the form of objects or collections of objects
(from
objectoriented programming), in some binary or textual form, adhering to
some interface
description language (IDL) so that the component may exist autonomously from
other
components in a computer.

In programming, the term component is generally used for an object that is
reusable and can
interact with other objects. In the .NET Framework a component is a class
that implements
the System.ComponentModel.IComponent interface or one that derives directly
or
indirectly from a class that implements this interface. The default base
class implementation
of the IComponent interface is System.ComponentModel.Component.
Component is the base class for all components in the common language
runtime (CLR) that
marshal by reference.
Inheritance Hierarchy:
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Derived Classes
You can host a Component in any object that implements the IContainer
interface, and you
can query and get services from its container. The container creates an
ISite for each
Component it contains. The container uses the site to manage the Component
and is used by
the Component to communicate with its container. When you create a component
in C#, it
can be used by clients written in any other language that conforms to the
Common Language
Specification.
Every component is contained within a namespace as container. By default,
the namespace is
the name of your project. Users of your component assembly will add Imports
statements for
the namespaces containing components they want to access
Your component is initialized by its constructor (new) and destroyed by its
destructor
(finalize). Your component's constructor is called when an instance of your
component is
created; the constructor cannot be called thereafter. The destructor is
called just before your
component is destroyed by garbage collection and its memory is reclaimed.
If your component acquires system resources, such as database connections or
handles to
Windows system objects provide Dispose method so that users of your
component can choose
when to release those.


Using Class Library to design a component does all easier, because the Class
Library with
its Control template provide the necessary methods

//Tony
 
A

Arne Vajhøj

Below is some text that I don't figure out what they are trying to say.
What I do know is that a component in .NET is a DLL either without user
representation or with user representation.
Maybe someone could tell me what they are trying to say.

They are saying that it has to be a DLL (A unit of independent
deployment and versioning) *and* with a simple interface
(Encapsulated i.e., non-investigable through its interfaces) *and*
not tied to being used in win forms or web (Multiple-use +
Non-context-specific).

Which I agree with.

Then they continue saying that in .NET you use the
System.ComponentModel namespace to create components.

Which I don't agree with. You *can* use that. But you can
also do it differently.
1. Programming with components
A software component is a system element offering a predefined service and
able to
communicate with other components. Clemens Szyperski and David Messerschmitt
give the
following five criteria for what a software component shall be to fulfil the
definition:
. Multiple-use
. Non-context-specific
. Composable with other components
. Encapsulated i.e., non-investigable through its interfaces
. A unit of independent deployment and versioning.

Software components often take the form of objects or collections of objects
(from
objectoriented programming), in some binary or textual form, adhering to
some interface
description language (IDL) so that the component may exist autonomously from
other
components in a computer.

In programming, the term component is generally used for an object that is
reusable and can
interact with other objects. In the .NET Framework a component is a class
that implements
the System.ComponentModel.IComponent interface or one that derives directly
or
indirectly from a class that implements this interface. The default base
class implementation
of the IComponent interface is System.ComponentModel.Component.
Component is the base class for all components in the common language
runtime (CLR) that
marshal by reference.
Inheritance Hierarchy:
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
Derived Classes
You can host a Component in any object that implements the IContainer
interface, and you
can query and get services from its container. The container creates an
ISite for each
Component it contains. The container uses the site to manage the Component
and is used by
the Component to communicate with its container. When you create a component
in C#, it
can be used by clients written in any other language that conforms to the
Common Language
Specification.
Every component is contained within a namespace as container. By default,
the namespace is
the name of your project. Users of your component assembly will add Imports
statements for
the namespaces containing components they want to access
Your component is initialized by its constructor (new) and destroyed by its
destructor
(finalize). Your component's constructor is called when an instance of your
component is
created; the constructor cannot be called thereafter. The destructor is
called just before your
component is destroyed by garbage collection and its memory is reclaimed.
If your component acquires system resources, such as database connections or
handles to
Windows system objects provide Dispose method so that users of your
component can choose
when to release those.


Using Class Library to design a component does all easier, because the Class
Library with
its Control template provide the necessary methods

Arne
 
T

Tony Johansson

Good explained Arne.!!

//Tony

Arne Vajhøj said:
They are saying that it has to be a DLL (A unit of independent
deployment and versioning) *and* with a simple interface
(Encapsulated i.e., non-investigable through its interfaces) *and*
not tied to being used in win forms or web (Multiple-use +
Non-context-specific).

Which I agree with.

Then they continue saying that in .NET you use the
System.ComponentModel namespace to create components.

Which I don't agree with. You *can* use that. But you can
also do it differently.


Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top