Click here to Skip to main content
15,913,587 members
Home / Discussions / C#
   

C#

 
GeneralC# app using Crystal Reports Pin
braber17-Jan-05 6:19
braber17-Jan-05 6:19 
GeneralXML-Updating of record Pin
Adnan Siddiqi17-Jan-05 6:14
Adnan Siddiqi17-Jan-05 6:14 
GeneralC# class hierarchy Pin
Peter Andersson17-Jan-05 5:50
Peter Andersson17-Jan-05 5:50 
GeneralRe: C# class hierarchy Pin
Heath Stewart17-Jan-05 6:18
protectorHeath Stewart17-Jan-05 6:18 
GeneralRe: C# class hierarchy Pin
17-Jan-05 11:55
suss17-Jan-05 11:55 
Generalnetwork path in conjunction with file.exists Pin
RB@Emphasys17-Jan-05 5:38
RB@Emphasys17-Jan-05 5:38 
GeneralRe: network path in conjunction with file.exists Pin
Heath Stewart17-Jan-05 6:28
protectorHeath Stewart17-Jan-05 6:28 
Generalinternal interfaces Pin
emission17-Jan-05 2:27
emission17-Jan-05 2:27 
Hi!

I'm writing a wrapper assembly for an interop assembly that's not very nicely implemented. The interop is wrapping a COM object that was primarily meant to work with VBScript, and many methods return untyped values, although they could indeed return them typed.

Almost all classes in the assembly have the following structure

<br />
<br />
internal interface IBaseObject<br />
{<br />
   //returns the untyped, wrapped object<br />
   object baseobject{get;}<br />
}<br />
<br />
public class WrappedSomething : IBaseObject<br />
{<br />
   private InteropSomething _baseobject;  <br />
   public WrappedSomething(InteropSomething baseObject)<br />
   {<br />
      _baseobject=baseObject;<br />
   }<br />
   public object baseobject<br />
   {<br />
      get{return _baseobject;}<br />
   }<br />
}<br />


The IBaseObjct interface is there to make it easy to pass these wrapped objects around inside the assembly, and give easy access to the wrapped object.

Of course this works just fine, but I don't like the fact that the classes exposes the property baseobject publicly. I don't want to give other assemblies access to the wrapped object. At least not as easily as it becomes when the property is public.

I could of course solve it by inheriting an internal class, but quite a few of the classes benifits greatly from inheriting other common (publi) functionality from other classes, and since there is no multiple inheritance....

Any suggestions?

Wouldn't is be viable to have the option to implement internal interfaces' methods internal only?



<br />
internal interface ISomething<br />
{<br />
  int DoInternalStuff();<br />
}<br />
<br />
public class Dog : ISomething<br />
{<br />
  internal int DoInternalStuff()<br />
  {<br />
    ///DO stuff<br />
  }<br />
}<br />


Since the interface is internal, I can't see any problem with declaring the implementing methods internal as well.
GeneralRe: internal interfaces Pin
leppie17-Jan-05 4:36
leppie17-Jan-05 4:36 
GeneralRe: internal interfaces Pin
emission17-Jan-05 6:15
emission17-Jan-05 6:15 
GeneralRe: internal interfaces Pin
Heath Stewart17-Jan-05 6:41
protectorHeath Stewart17-Jan-05 6:41 
GeneralRe: internal interfaces Pin
emission17-Jan-05 10:02
emission17-Jan-05 10:02 
GeneralRe: internal interfaces Pin
Heath Stewart17-Jan-05 10:52
protectorHeath Stewart17-Jan-05 10:52 
GeneralRe: internal interfaces Pin
emission17-Jan-05 12:30
emission17-Jan-05 12:30 
Generaldebugging diabled Pin
Member 166075017-Jan-05 2:25
Member 166075017-Jan-05 2:25 
GeneralRe: debugging diabled Pin
Heath Stewart17-Jan-05 7:11
protectorHeath Stewart17-Jan-05 7:11 
GeneralCreating ms installer with V. C# Pin
basbous17-Jan-05 2:13
basbous17-Jan-05 2:13 
GeneralRe: Creating ms installer with V. C# Pin
Heath Stewart17-Jan-05 6:46
protectorHeath Stewart17-Jan-05 6:46 
GeneralC# Pin
Anonymous17-Jan-05 2:10
Anonymous17-Jan-05 2:10 
GeneralRe: C# Pin
johnhebert17-Jan-05 4:42
johnhebert17-Jan-05 4:42 
GeneralListing a files in a client directory Pin
Sree7417-Jan-05 1:46
sussSree7417-Jan-05 1:46 
GeneralRe: Listing a files in a client directory Pin
Heath Stewart17-Jan-05 6:52
protectorHeath Stewart17-Jan-05 6:52 
GeneralRe: Listing a files in a client directory Pin
Member 37818918-Jan-05 4:04
Member 37818918-Jan-05 4:04 
GeneralReading local file on the client side Pin
Sreeanth17-Jan-05 1:37
sussSreeanth17-Jan-05 1:37 
GeneralRe: Reading local file on the client side Pin
leppie17-Jan-05 4:40
leppie17-Jan-05 4: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.