F
Francesco Spegni
hi there,
i hope this message is not out of topic. i've a question about how to
realize a small architecture based on webservice and whose goal is
ensure a good level o flexibility of my code.
in a few words: i've a webservice which exports the method
Authenticate(User usCurrUser). the data type User should be an
abstract class like this:
public abstract class User
{
public abstract bool Validate();
}
what i wish to do would be to create a subclass of it like
public abstract class UserSub : User
{
public UserSub(string strUserId, string strPassword)
{
...<the actual code>...
}
public override bool Validate()
{
...<the actual code>...
}
}
and pass an istance of the subclass to the webservice. the behavior i
expect is that the webservice, calling the abstract method Validate(),
will indeed call the Validate() method specified in the UserSub
class.
why all this? i guess you can easily imagine that if i'm able to
realize this i can change the way to authenticate my users (let's say
no more by userid and password but, instead, by fingerprints) without
need to change the proxy through which my client application calls the
webservice. i "just" need to change the webservice code and the client
code.
i've googled a bit, but i still cannot figure how to realize an
architecture like this. does any of you have some suggestion for my
problem?
i thank you in advance for any help you can give me,
have a nice day
francesco
i hope this message is not out of topic. i've a question about how to
realize a small architecture based on webservice and whose goal is
ensure a good level o flexibility of my code.
in a few words: i've a webservice which exports the method
Authenticate(User usCurrUser). the data type User should be an
abstract class like this:
public abstract class User
{
public abstract bool Validate();
}
what i wish to do would be to create a subclass of it like
public abstract class UserSub : User
{
public UserSub(string strUserId, string strPassword)
{
...<the actual code>...
}
public override bool Validate()
{
...<the actual code>...
}
}
and pass an istance of the subclass to the webservice. the behavior i
expect is that the webservice, calling the abstract method Validate(),
will indeed call the Validate() method specified in the UserSub
class.
why all this? i guess you can easily imagine that if i'm able to
realize this i can change the way to authenticate my users (let's say
no more by userid and password but, instead, by fingerprints) without
need to change the proxy through which my client application calls the
webservice. i "just" need to change the webservice code and the client
code.
i've googled a bit, but i still cannot figure how to realize an
architecture like this. does any of you have some suggestion for my
problem?
i thank you in advance for any help you can give me,
have a nice day
francesco