473,394 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Interface question

I am trying to understand why I would use interfaces.

In the following example for IPrinciple, I have the following code:

************************************************** **********
using System;
using System.Collections;
using System.Security;
using System.Security.Principal;

namespace CustomSecurity
{
[Serializable]
public class CustomPrincipal: IPrincipal
{
private IIdentity identity;
private ArrayList roles;

public CustomPrincipal(IIdentity id, ArrayList rolesArray)
{
identity = id;
roles = rolesArray;
}
public bool IsInRole(string role)
{
return roles.Contains( role );
}

public IIdentity Identity
{
get { return identity; }
set { identity = value; }
}
}
}
************************************************** ***

I understand that IPrincipal (and IIdentity) is defined as:

************************************************** *******
namespace System.Security.Principal {
interface IIdentity {
bool IsAuthenticated { get; }
string AuthenticationType { get; }
string Name { get; }
}
interface IPrincipal {
IIdentity Identity { get; }
bool IsInRole(string role);
}
}
************************************************** ********

What would be the difference if I just wrote the code as (I understand that
I also would have the IIdentity class also).:

************************************************** ********
using System;
using System.Collections;
using System.Security;

namespace CustomSecurity
{
[Serializable]
public class CustomPrincipal
{
private IIdentity identity;
private ArrayList roles;

public CustomPrincipal(IIdentity id, ArrayList rolesArray)
{
identity = id;
roles = rolesArray;
}
public bool IsInRole(string role)
{
return roles.Contains( role );
}

public IIdentity Identity
{
get { return identity; }
set { identity = value; }
}
}
}
************************************************** ***

Does the system handle it any different?

Thanks,

Tom
Apr 23 '06 #1
7 1202
Implementing the IPrinciple interface won't have any affect on how your
CustomPrincipal class behaves.

The difference is if you have a function that requires an argument of
type IPrincipal (sorry I don't have an example handy). You would be
able to pass an instance of your first CustomPrincipal in to that
function, but the second would generate a compiler error since it's not
the right type.

It's kinda late, so I hope that made sense.

tshad wrote:
I am trying to understand why I would use interfaces.

In the following example for IPrinciple, I have the following code:

************************************************** **********
using System;
using System.Collections;
using System.Security;
using System.Security.Principal;

namespace CustomSecurity
{
[Serializable]
public class CustomPrincipal: IPrincipal
{
private IIdentity identity;
private ArrayList roles;

public CustomPrincipal(IIdentity id, ArrayList rolesArray)
{
identity = id;
roles = rolesArray;
}
public bool IsInRole(string role)
{
return roles.Contains( role );
}

public IIdentity Identity
{
get { return identity; }
set { identity = value; }
}
}
}
************************************************** ***

I understand that IPrincipal (and IIdentity) is defined as:

************************************************** *******
namespace System.Security.Principal {
interface IIdentity {
bool IsAuthenticated { get; }
string AuthenticationType { get; }
string Name { get; }
}
interface IPrincipal {
IIdentity Identity { get; }
bool IsInRole(string role);
}
}
************************************************** ********

What would be the difference if I just wrote the code as (I understand that
I also would have the IIdentity class also).:

************************************************** ********
using System;
using System.Collections;
using System.Security;

namespace CustomSecurity
{
[Serializable]
public class CustomPrincipal
{
private IIdentity identity;
private ArrayList roles;

public CustomPrincipal(IIdentity id, ArrayList rolesArray)
{
identity = id;
roles = rolesArray;
}
public bool IsInRole(string role)
{
return roles.Contains( role );
}

public IIdentity Identity
{
get { return identity; }
set { identity = value; }
}
}
}
************************************************** ***

Does the system handle it any different?

Thanks,

Tom


--
David Hogue
Apr 23 '06 #2
"David Hogue" <da************@gmail.com> wrote in message
news:uB******************@fe06.news.easynews.com.. .
Implementing the IPrinciple interface won't have any affect on how your
CustomPrincipal class behaves.

The difference is if you have a function that requires an argument of
type IPrincipal (sorry I don't have an example handy). You would be
able to pass an instance of your first CustomPrincipal in to that
function, but the second would generate a compiler error since it's not
the right type.
Is that the main reason? Other than setting up security, why would I need
IPrincipal and IIdentity?

I am not trying to NOT use it. I am just trying to find out why it is
better than the identical code, without the IPrincipal inheritance.

I assume that the windows Authorization, such as Forms, doesn't need it. I
mean does windows (IIS) look for IPrincipal and IIdentity when it is using
managed security context?

Also, is CustomPrincipal of type IPrincipal just because it inherits from it
(maybe I am getting inheritance confused with interfaces).

I am trying to see all the reasons why to use interfaces.

Thanks,

Tom

It's kinda late, so I hope that made sense.

tshad wrote:
I am trying to understand why I would use interfaces.

In the following example for IPrinciple, I have the following code:

************************************************** **********
using System;
using System.Collections;
using System.Security;
using System.Security.Principal;

namespace CustomSecurity
{
[Serializable]
public class CustomPrincipal: IPrincipal
{
private IIdentity identity;
private ArrayList roles;

public CustomPrincipal(IIdentity id, ArrayList rolesArray)
{
identity = id;
roles = rolesArray;
}
public bool IsInRole(string role)
{
return roles.Contains( role );
}

public IIdentity Identity
{
get { return identity; }
set { identity = value; }
}
}
}
************************************************** ***

I understand that IPrincipal (and IIdentity) is defined as:

************************************************** *******
namespace System.Security.Principal {
interface IIdentity {
bool IsAuthenticated { get; }
string AuthenticationType { get; }
string Name { get; }
}
interface IPrincipal {
IIdentity Identity { get; }
bool IsInRole(string role);
}
}
************************************************** ********

What would be the difference if I just wrote the code as (I understand that I also would have the IIdentity class also).:

************************************************** ********
using System;
using System.Collections;
using System.Security;

namespace CustomSecurity
{
[Serializable]
public class CustomPrincipal
{
private IIdentity identity;
private ArrayList roles;

public CustomPrincipal(IIdentity id, ArrayList rolesArray)
{
identity = id;
roles = rolesArray;
}
public bool IsInRole(string role)
{
return roles.Contains( role );
}

public IIdentity Identity
{
get { return identity; }
set { identity = value; }
}
}
}
************************************************** ***

Does the system handle it any different?

Thanks,

Tom


--
David Hogue


Apr 23 '06 #3
tshad wrote:
"David Hogue" <da************@gmail.com> wrote in message
news:uB******************@fe06.news.easynews.com.. .
Implementing the IPrinciple interface won't have any affect on how your
CustomPrincipal class behaves.

The difference is if you have a function that requires an argument of
type IPrincipal (sorry I don't have an example handy). You would be
able to pass an instance of your first CustomPrincipal in to that
function, but the second would generate a compiler error since it's not
the right type.
Is that the main reason? Other than setting up security, why would I need
IPrincipal and IIdentity?


My understanding of IPrincipal and IIdentity isn't the best, but I
believe they are used primarily for security. Setting user roles and
that kind of thing.
I am not trying to NOT use it. I am just trying to find out why it is
better than the identical code, without the IPrincipal inheritance.
It's only better if you need treat the class as an IPrincipal.
I assume that the windows Authorization, such as Forms, doesn't need it. I
mean does windows (IIS) look for IPrincipal and IIdentity when it is using
managed security context?
Windows and Forms based authentication both use the interfaces, but you
don't need to interact with them directly unless you want to change
default behavior.

For example: The company I work for has a system with users and roles
stored in a database. When a request is authenticated we get a list of
roles and create a GenericPrincipal (GenericPrincipal implements
IPrincipal):

string[] userRoles = db.GetUserRoles(Context.User.Identity.Name);
Context.User = new GenericPrincipal(Context.User.Identity, userRoles);

Though we didn't use a custom principal class we could have and it might
look something like this:

public class SmartzPrincipal : IPrincipal
{
private IIdentity identity;
public SmartzPrincipal(IIdentity identity)
{
this.identity = identity;
}

public IIdentity Identity
{
get { return identity; }
}

public IsInRoles(String role)
{
List<string> roles = db.GetUserRoles(identity.Name);
return roles.Contains(role);
}
}

Then we would use it like so:

Context.User = new SmartzPrincipal(Context.User.Identity);

While the version with the interface looks longer in my example it would
actually be simpler than what we have. It would encapsulate all the
role based code in one place and be more reusable.
Also, is CustomPrincipal of type IPrincipal just because it inherits from it
(maybe I am getting inheritance confused with interfaces).
Implements is the word I hear most often when referring to interfaces.
It's really the same concept as inheriting from a base class, except you
can implement multiple interfaces and only inherit from one base class.

CustomPrincipal is of type IPrincipal because it implements it.
I am trying to see all the reasons why to use interfaces.

Thanks,

Tom


I hope I'm helping and not just confusing things...

--
David Hogue
Apr 23 '06 #4
"David Hogue" <da************@gmail.com> wrote in message
news:No*******************@fe05.news.easynews.com. ..
tshad wrote:
"David Hogue" <da************@gmail.com> wrote in message
news:uB******************@fe06.news.easynews.com.. .
Implementing the IPrinciple interface won't have any affect on how your
CustomPrincipal class behaves.

The difference is if you have a function that requires an argument of
type IPrincipal (sorry I don't have an example handy). You would be
able to pass an instance of your first CustomPrincipal in to that
function, but the second would generate a compiler error since it's not
the right type.
Is that the main reason? Other than setting up security, why would I
need
IPrincipal and IIdentity?


My understanding of IPrincipal and IIdentity isn't the best, but I
believe they are used primarily for security. Setting user roles and
that kind of thing.
I am not trying to NOT use it. I am just trying to find out why it is
better than the identical code, without the IPrincipal inheritance.


It's only better if you need treat the class as an IPrincipal.
I assume that the windows Authorization, such as Forms, doesn't need it.
I
mean does windows (IIS) look for IPrincipal and IIdentity when it is
using
managed security context?


Windows and Forms based authentication both use the interfaces, but you
don't need to interact with them directly unless you want to change
default behavior.

For example: The company I work for has a system with users and roles
stored in a database. When a request is authenticated we get a list of
roles and create a GenericPrincipal (GenericPrincipal implements
IPrincipal):


That is what I am curious about.

When you talk about users and roles stored in a database, are you talking
about Windows Users and Roles (User Policies)?

I assume you can't use the GenericPrincipal to handle your own users and
roles, such as office managers and their roles. These would be stored in
your own database and the GenericPrincipal wouldn't know about that.

string[] userRoles = db.GetUserRoles(Context.User.Identity.Name);
Context.User = new GenericPrincipal(Context.User.Identity, userRoles);

Though we didn't use a custom principal class we could have and it might
look something like this:

If you didn't use a custom principal class, I assume you don't store your
own users, roles a policies, right?
public class SmartzPrincipal : IPrincipal
{
private IIdentity identity;
public SmartzPrincipal(IIdentity identity)
{
this.identity = identity;
}

public IIdentity Identity
{
get { return identity; }
}

public IsInRoles(String role)
{
List<string> roles = db.GetUserRoles(identity.Name);
return roles.Contains(role);
}
}

Then we would use it like so:

Context.User = new SmartzPrincipal(Context.User.Identity);

While the version with the interface looks longer in my example it would
actually be simpler than what we have. It would encapsulate all the
role based code in one place and be more reusable.
Also, is CustomPrincipal of type IPrincipal just because it inherits from
it
(maybe I am getting inheritance confused with interfaces).
Implements is the word I hear most often when referring to interfaces.
It's really the same concept as inheriting from a base class, except you
can implement multiple interfaces and only inherit from one base class.

CustomPrincipal is of type IPrincipal because it implements it.
I am trying to see all the reasons why to use interfaces.

Thanks,

Tom


I hope I'm helping and not just confusing things...


You are. I am just trying to really understand it. I sort of understand
interfaces, but am trying to find the reasons to use them vs when not to use
them. Just because you can doesn't mean you should (in all cases).

Thanks,

Tom
--
David Hogue

Apr 24 '06 #5
tshad wrote:
"David Hogue" <da************@gmail.com> wrote in message
news:No*******************@fe05.news.easynews.com. ..
tshad wrote:
"David Hogue" <da************@gmail.com> wrote in message
news:uB******************@fe06.news.easynews.com.. .
Implementing the IPrinciple interface won't have any affect on how your
CustomPrincipal class behaves.

The difference is if you have a function that requires an argument of
type IPrincipal (sorry I don't have an example handy). You would be
able to pass an instance of your first CustomPrincipal in to that
function, but the second would generate a compiler error since it's not
the right type.
Is that the main reason? Other than setting up security, why would I
need
IPrincipal and IIdentity?

My understanding of IPrincipal and IIdentity isn't the best, but I
believe they are used primarily for security. Setting user roles and
that kind of thing.
I am not trying to NOT use it. I am just trying to find out why it is
better than the identical code, without the IPrincipal inheritance.

It's only better if you need treat the class as an IPrincipal.
I assume that the windows Authorization, such as Forms, doesn't need it.
I
mean does windows (IIS) look for IPrincipal and IIdentity when it is
using
managed security context?

Windows and Forms based authentication both use the interfaces, but you
don't need to interact with them directly unless you want to change
default behavior.

For example: The company I work for has a system with users and roles
stored in a database. When a request is authenticated we get a list of
roles and create a GenericPrincipal (GenericPrincipal implements
IPrincipal):


That is what I am curious about.

When you talk about users and roles stored in a database, are you talking
about Windows Users and Roles (User Policies)?

I assume you can't use the GenericPrincipal to handle your own users and
roles, such as office managers and their roles. These would be stored in
your own database and the GenericPrincipal wouldn't know about that.

We can (and did) use GenericPrincipal to handle our own users and roles.
This is because it is a "generic", for lack of a better term,
implementation of the IPrincipal interface. We can give a
GenericPrincipal an array of strings and it will return true from the
IsInRoles method if that role is in the array.

We did't have to create our own class that implemented IPrincipal,
GenericPrincipal was already there for us. However the downside is that
the code to get the users from the database still has to go somewhere
and it ended up mixed in with a bunch of unrelated code.
string[] userRoles = db.GetUserRoles(Context.User.Identity.Name);
Context.User = new GenericPrincipal(Context.User.Identity, userRoles);

Though we didn't use a custom principal class we could have and it might
look something like this:


If you didn't use a custom principal class, I assume you don't store your
own users, roles a policies, right?
public class SmartzPrincipal : IPrincipal
{
private IIdentity identity;
public SmartzPrincipal(IIdentity identity)
{
this.identity = identity;
}

public IIdentity Identity
{
get { return identity; }
}

public IsInRoles(String role)
{
List<string> roles = db.GetUserRoles(identity.Name);
return roles.Contains(role);
}
}

Then we would use it like so:

Context.User = new SmartzPrincipal(Context.User.Identity);

While the version with the interface looks longer in my example it would
actually be simpler than what we have. It would encapsulate all the
role based code in one place and be more reusable.
Also, is CustomPrincipal of type IPrincipal just because it inherits from
it
(maybe I am getting inheritance confused with interfaces).

Implements is the word I hear most often when referring to interfaces.
It's really the same concept as inheriting from a base class, except you
can implement multiple interfaces and only inherit from one base class.

CustomPrincipal is of type IPrincipal because it implements it.
I am trying to see all the reasons why to use interfaces.

Thanks,

Tom

I hope I'm helping and not just confusing things...


You are. I am just trying to really understand it. I sort of understand
interfaces, but am trying to find the reasons to use them vs when not to use
them. Just because you can doesn't mean you should (in all cases).

Interfaces and some of the more abstract object oriented ideas can be
difficult to fully understand. I've been working with object oriented
languages for years, but it's only relatively recently that my code has
become more object oriented.

I would suggest reading up on design patterns for some insight into how
interfaces are often used. There was a recent article on codebetter.com
that might be a good place to start:
http://codebetter.com/blogs/jeremy.m...11/142665.aspx

--
David Hogue
Apr 25 '06 #6
David very good links there
Patrick
"David Hogue" <da************@gmail.com> wrote in message
news:z3*******************@fe08.news.easynews.com. ..
tshad wrote:
"David Hogue" <da************@gmail.com> wrote in message
news:No*******************@fe05.news.easynews.com. ..
tshad wrote:
"David Hogue" <da************@gmail.com> wrote in message
news:uB******************@fe06.news.easynews.com.. .
> Implementing the IPrinciple interface won't have any affect on how
> your
> CustomPrincipal class behaves.
>
> The difference is if you have a function that requires an argument of
> type IPrincipal (sorry I don't have an example handy). You would be
> able to pass an instance of your first CustomPrincipal in to that
> function, but the second would generate a compiler error since it's
> not
> the right type.
Is that the main reason? Other than setting up security, why would I
need
IPrincipal and IIdentity?
My understanding of IPrincipal and IIdentity isn't the best, but I
believe they are used primarily for security. Setting user roles and
that kind of thing.

I am not trying to NOT use it. I am just trying to find out why it is
better than the identical code, without the IPrincipal inheritance.
It's only better if you need treat the class as an IPrincipal.

I assume that the windows Authorization, such as Forms, doesn't need
it.
I
mean does windows (IIS) look for IPrincipal and IIdentity when it is
using
managed security context?
Windows and Forms based authentication both use the interfaces, but you
don't need to interact with them directly unless you want to change
default behavior.

For example: The company I work for has a system with users and roles
stored in a database. When a request is authenticated we get a list of
roles and create a GenericPrincipal (GenericPrincipal implements
IPrincipal):


That is what I am curious about.

When you talk about users and roles stored in a database, are you talking
about Windows Users and Roles (User Policies)?

I assume you can't use the GenericPrincipal to handle your own users and
roles, such as office managers and their roles. These would be stored in
your own database and the GenericPrincipal wouldn't know about that.

We can (and did) use GenericPrincipal to handle our own users and roles.
This is because it is a "generic", for lack of a better term,
implementation of the IPrincipal interface. We can give a
GenericPrincipal an array of strings and it will return true from the
IsInRoles method if that role is in the array.

We did't have to create our own class that implemented IPrincipal,
GenericPrincipal was already there for us. However the downside is that
the code to get the users from the database still has to go somewhere
and it ended up mixed in with a bunch of unrelated code.
string[] userRoles = db.GetUserRoles(Context.User.Identity.Name);
Context.User = new GenericPrincipal(Context.User.Identity, userRoles);

Though we didn't use a custom principal class we could have and it might
look something like this:


If you didn't use a custom principal class, I assume you don't store your
own users, roles a policies, right?
public class SmartzPrincipal : IPrincipal
{
private IIdentity identity;
public SmartzPrincipal(IIdentity identity)
{
this.identity = identity;
}

public IIdentity Identity
{
get { return identity; }
}

public IsInRoles(String role)
{
List<string> roles = db.GetUserRoles(identity.Name);
return roles.Contains(role);
}
}

Then we would use it like so:

Context.User = new SmartzPrincipal(Context.User.Identity);

While the version with the interface looks longer in my example it would
actually be simpler than what we have. It would encapsulate all the
role based code in one place and be more reusable.

Also, is CustomPrincipal of type IPrincipal just because it inherits
from
it
(maybe I am getting inheritance confused with interfaces).
Implements is the word I hear most often when referring to interfaces.
It's really the same concept as inheriting from a base class, except you
can implement multiple interfaces and only inherit from one base class.

CustomPrincipal is of type IPrincipal because it implements it.

I am trying to see all the reasons why to use interfaces.

Thanks,

Tom
I hope I'm helping and not just confusing things...


You are. I am just trying to really understand it. I sort of understand
interfaces, but am trying to find the reasons to use them vs when not to
use
them. Just because you can doesn't mean you should (in all cases).

Interfaces and some of the more abstract object oriented ideas can be
difficult to fully understand. I've been working with object oriented
languages for years, but it's only relatively recently that my code has
become more object oriented.

I would suggest reading up on design patterns for some insight into how
interfaces are often used. There was a recent article on codebetter.com
that might be a good place to start:
http://codebetter.com/blogs/jeremy.m...11/142665.aspx

--
David Hogue

Apr 25 '06 #7

"David Hogue" <da************@gmail.com> wrote in message
news:z3*******************@fe08.news.easynews.com. ..
tshad wrote:
"David Hogue" <da************@gmail.com> wrote in message
news:No*******************@fe05.news.easynews.com. ..
tshad wrote:
"David Hogue" <da************@gmail.com> wrote in message
news:uB******************@fe06.news.easynews.com.. .
> Implementing the IPrinciple interface won't have any affect on how
> your
> CustomPrincipal class behaves.
>
> The difference is if you have a function that requires an argument of
> type IPrincipal (sorry I don't have an example handy). You would be
> able to pass an instance of your first CustomPrincipal in to that
> function, but the second would generate a compiler error since it's
> not
> the right type.
Is that the main reason? Other than setting up security, why would I
need
IPrincipal and IIdentity?
My understanding of IPrincipal and IIdentity isn't the best, but I
believe they are used primarily for security. Setting user roles and
that kind of thing.

I am not trying to NOT use it. I am just trying to find out why it is
better than the identical code, without the IPrincipal inheritance.
It's only better if you need treat the class as an IPrincipal.

I assume that the windows Authorization, such as Forms, doesn't need
it.
I
mean does windows (IIS) look for IPrincipal and IIdentity when it is
using
managed security context?
Windows and Forms based authentication both use the interfaces, but you
don't need to interact with them directly unless you want to change
default behavior.

For example: The company I work for has a system with users and roles
stored in a database. When a request is authenticated we get a list of
roles and create a GenericPrincipal (GenericPrincipal implements
IPrincipal):
That is what I am curious about.

When you talk about users and roles stored in a database, are you talking
about Windows Users and Roles (User Policies)?

I assume you can't use the GenericPrincipal to handle your own users and
roles, such as office managers and their roles. These would be stored in
your own database and the GenericPrincipal wouldn't know about that.

We can (and did) use GenericPrincipal to handle our own users and roles.
This is because it is a "generic", for lack of a better term,
implementation of the IPrincipal interface. We can give a
GenericPrincipal an array of strings and it will return true from the
IsInRoles method if that role is in the array.

We did't have to create our own class that implemented IPrincipal,
GenericPrincipal was already there for us. However the downside is that
the code to get the users from the database still has to go somewhere
and it ended up mixed in with a bunch of unrelated code.
string[] userRoles = db.GetUserRoles(Context.User.Identity.Name);
Context.User = new GenericPrincipal(Context.User.Identity, userRoles);
I assume that if you use the GenericPrincipal, you need to use it as is and
if you want to add anything else (another method, some special test, read
from your user table etc) , you would need to create another class (as you
did below with SmartzPrincipal).

Though we didn't use a custom principal class we could have and it might
look something like this:

This is my question.

If you created your SmartzPrincipal and you used all the methods defined in
IPrincipal, why use IPrincipal at all?

What does it do for you? That's what I am trying to get my mind around.

If you didn't use a custom principal class, I assume you don't store your
own users, roles a policies, right?
public class SmartzPrincipal : IPrincipal
{
private IIdentity identity;
public SmartzPrincipal(IIdentity identity)
{
this.identity = identity;
}

public IIdentity Identity
{
get { return identity; }
}

public IsInRoles(String role)
{
List<string> roles = db.GetUserRoles(identity.Name);
return roles.Contains(role);
}
}

Then we would use it like so:

Context.User = new SmartzPrincipal(Context.User.Identity);

While the version with the interface looks longer in my example it would
actually be simpler than what we have. It would encapsulate all the
role based code in one place and be more reusable.

Also, is CustomPrincipal of type IPrincipal just because it inherits
from
it
(maybe I am getting inheritance confused with interfaces).
Implements is the word I hear most often when referring to interfaces.
It's really the same concept as inheriting from a base class, except you
can implement multiple interfaces and only inherit from one base class.

CustomPrincipal is of type IPrincipal because it implements it.

I am trying to see all the reasons why to use interfaces.

Thanks,

Tom
I hope I'm helping and not just confusing things...


You are. I am just trying to really understand it. I sort of understand
interfaces, but am trying to find the reasons to use them vs when not to
use
them. Just because you can doesn't mean you should (in all cases).

Interfaces and some of the more abstract object oriented ideas can be
difficult to fully understand. I've been working with object oriented
languages for years, but it's only relatively recently that my code has
become more object oriented.

I would suggest reading up on design patterns for some insight into how
interfaces are often used. There was a recent article on codebetter.com
that might be a good place to start:
http://codebetter.com/blogs/jeremy.m...11/142665.aspx


Looks like a great article.

Will look at it later today.

Thanks,

Tom
--
David Hogue

Apr 25 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

65
by: perseus | last post by:
I think that everyone who told me that my question is irrelevant, in particular Mr. David White, is being absolutely ridiculous. Obviously, most of you up here behave like the owners of the C++...
26
by: Marius Horak | last post by:
As in subject. Thanks MH
4
by: jm | last post by:
Consider: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbconwhenshouldiimplementinterfacesinmycomponent.asp // Code for the IAccount interface module. public...
20
by: Ole Hanson | last post by:
I am accessing my database through an interface, to allow future substitution of the physical datastore - hence I would like to declare in my Interface that my DAL-objects implementing the...
13
by: John Salerno | last post by:
Hi all. I have a question about interfaces now. According to the book I'm reading, when you implement an interface, the class or structure has to declare all the methods that the interface...
6
by: John Salerno | last post by:
I understand how they work (basically), but I think maybe the examples I'm reading are too elementary to really show their value. Here's one from Programming C#: #region Using directives ...
10
by: Joe | last post by:
My question is more an OOD question. I know *how* to implement both abstract classes and interfaces. Here's my question - under what circumstacnes does one use an abstract class and under what...
4
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. ...
5
by: Colin McGuire | last post by:
Hi all, when I write the class below Private Class employee End Class and then add the line "Implements IVF" which is an interface I have written, the IDE modifies my code to display
52
by: Ben Voigt [C++ MVP] | last post by:
I get C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.