Skip to content

Declaring an Eye for an IEyees

June 23, 2011
AngryJayBird: public interface iEye()
{
function Look():void;
function See():void;
function Blink():void;
}
AngryJayBird: sometimes, you need to determine if your obj was an IEye-eye, or just a regular eye….
Me: public class Captain : IEye
{

}
Me: IEyeEye’s are more related to ICarumbas than IEye’s
AngryJayBird: exactly
 public interface IEye()
{
function Look():void;
function See():void;
function Blink():void;
function Captain():void;
function Matey():void;
}
Me: I don’t think we’re designing this relationship correctly.  For example it would probably be
public class Captain
{
      IEye RightEye;
}
public class Matey
{
IEye LeftEye;
IEye RightEye;
}
We also need to add an
public interface IPatch
{
}
AngryJayBird:
 public class LazyEye: IEye
{
     …
}
 public class CrazyEye: IEye
{
     …
}
BeadyEyes come in pairs though
IList BeadyEyes = new List{ new BeadyEye(), new BeadyEye()};
Me: public class GlassEye : IEye
{
public void Look()
{
throw new NotImplementedException;
}
      …
}
Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: