Help with OO Model



I'm designing an OO Model for a large application, and I have some question
on how to model a particular situation; it's not directly related to C# but
rather to general OO. The applicaiton will be developed in C# 2.0 though,
which may have some influence on the OO model.
Here's what I'm trying to model:

I have a class Company, a class Publisher, a class Manufacturer and a class
Distributor.
Their relationships are as follows:
1. A Publisher is a Company
2. A Manufacturer is a Company
3. A Distributor is a Company
6. A Company can be just a distributor
4. A Company can be just a publisher or a publisher and distributor at the
same time
5. A Company can be just a manufacturer or a manufacturer and distributor at
the same time
7. A Company can be a publisher, manufacturer and distributor all at the
same time

A Publisher and a Manufacturer are very similar in that they both create a
product; however, I think of the two roles differently and would prefer to
maintain them as different entity types. I would like to see code like
Publisher.Product when I'm dealing with printed material and
Manufacturer.Product when I'm dealing with non-printed material.
On the other hand, given a Product I would like to be able to return its
creator, which could be either a manufacturer or a publisher, depending on
the kind of product.

Any insights or recommendations are greatly appreciated.

-- Hans


.



Relevant Pages

  • Re: Help with OO Model
    ... So in the example code where I show passing in a string: xxx.GetCompany ("Distributor"), you can pass in the actual class type ) and not have to deal w/ maintaining strings to represent the various company classes. ... I have a class Company, a class Publisher, a class Manufacturer and a class ... A Publisher is a Company ...
    (microsoft.public.dotnet.languages.csharp)
  • Domain Model/Object Design question
    ... finding the correct design pattern. ... A class "Publisher", which is a type of company with a particular ... "Manufacturer" as well, since they create books, but they do more than ... A company can be a manufacturer, publisher or distributor, or any ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help with OO Model
    ... A Publisher is a Company ... A Manufacturer is a Company ... A Distributor is a Company ... public class Distributor: Role ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help with OO Model
    ... A Publisher is a Company ... A Manufacturer is a Company ... A Distributor is a Company ... Manufacturer.Product when I'm dealing with non-printed material. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help with OO Model
    ... The key to your problem is I think that you want to compose companies dynamically, at run time in the client code. ... Publisher OJWhoDunItInc = new Publisher; ... A Manufacturer is a Company ... A Distributor is a Company ...
    (microsoft.public.dotnet.languages.csharp)

Loading