C# interfaces, loading just the methods of the interface in the child class not the whole object int

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

If you make an interface like this public interface IProcessInterface, and
you have a subclass that uses that interface, along w/ other itnerfaces, but
you want only the methods identified in IProcessInterface to be loaded into
memory, is there a way to load only the interface methods and class data
instead of the whole object?
 
Daniel,
is there a way to load only the interface methods and class data
instead of the whole object?

That should be the current behavior, more or less. The "whole object"
is the class' instance data (plus a header). Method code is shared by
all instances, and code is JIT compiled as needed.



Mattias
 
are you concerned with efficiency, or are you concerned with hiding which
descendent of the interface is being used to fulfill the contract?

I'm not sure what you are trying to accomplish, so I'm not sure how to
respond.

--- Nick
 
No that is not possible. You will have to load the complete class into
memory, there is no way of loading a partial class.
 
Back
Top