Try working with a composition. The person and organization are not necessarily users, although both may have an address or user account. In fact, they most likely have more than one of them. If you think more in terms of HAS A and less in terms of IS A, you can come up with more convenient options. For example, you may have
class Address {
public string street {get; private set;}
public string city {get; private set;}
public AddressTypes AddressType {get; private set;}
...
}
now if you need to simulate the fact that both Personare and Organizationare things that Addresses should have , you can create an interface
interface IAddressable {
IEnumerable<Address> {get;}
}
Person Organization . Account, Username Password.
Person Organization BE User s, , , . , .
Client, . , " ( ) ". " ", Person .
, Person . , , , - , ( , ).
, :
abstract class Client : IAddressable, IWithAccount {
}
class PersonClient : Client
{
public PersonClient(Person person)
{
}
}
class OrganizationClient : Client
{
public OrganizationClient(Organization organization)
{
}
}
:
- , - () (Person, Organization).
- , , ,
StateClient