Jack Jackson
6/12/2008 9:03:00 PM
On Thu, 12 Jun 2008 08:09:26 -0700 (PDT), jmDesktop
<needin4mation@gmail.com> wrote:
>In the .NET framework, how does one class "see" another class? For
>example, in the DataTable class there is a method called NewRow(). It
>returns an object type DataRow. But how does DataTable know about
>DataRow? I guess this is more fundemental than .net. How does a
>framework no about the objects inside of it?
Any class can "see" any other classes that are in scope. Those other
classes might be Public classes on other assemblies to which the
current project has a reference, they might be Friend or Public
classes in the same project, or they might be Private classes
contained in the class.
DataTable only "knows" about DataRow because there is code in
DataTable that uses DataRow. The designer of the DataTable class
decided that the class that is used to represent rows in the DataTable
is DataRow, and coded accordingly, including defining the NewRow
method as:
Public Function NewRow As DataRow