G
Gerardo Herzig
Hi all. I have a question about design. The general question would be:
Where is the line beteween extending a class and adding new methods to
that class?
And the particular case im involved is:
I have a class (say USERCLASS) who implements a user interface. One of
his methods is called `login'. Later on i got the order of implementing
a `single login', which off course means a single user cant login if a
session is already started for that user. Extending comes to my mind at
first (it works good, actually). But now im thinikng if there some
problem in adding a method to the USERCLASS class named single_login(),
who will take care of applying the rules of single sign on.
Which one you guys will pick up? USERCLASS().single_login() or
SINGLELOGINUSERCLASS().login()
Thanks for your oppinions!
Gerardo
Where is the line beteween extending a class and adding new methods to
that class?
And the particular case im involved is:
I have a class (say USERCLASS) who implements a user interface. One of
his methods is called `login'. Later on i got the order of implementing
a `single login', which off course means a single user cant login if a
session is already started for that user. Extending comes to my mind at
first (it works good, actually). But now im thinikng if there some
problem in adding a method to the USERCLASS class named single_login(),
who will take care of applying the rules of single sign on.
Which one you guys will pick up? USERCLASS().single_login() or
SINGLELOGINUSERCLASS().login()
Thanks for your oppinions!
Gerardo