Re: Singular vs. Manager Business Layer Classes

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: headware (headware_at_aol.com)
Date: 06/23/04


Date: 22 Jun 2004 22:34:15 -0700

I appreciate all the replies. After reading a bit of the book
"Patterns of Enterprise Application Architecture" by Martin Fowler I
noticed a pattern called Table Module that basically describes what
we're doing. The pattern says that there are no classes that represent
single objects. The classes are based off the tables in the database
therefore they all represents sets of data. So I guess the answer is
that you only have People classes and no Person class. Which makes
sense since as we get more into the project and start writing code
it's becoming pretty obvious that there's really not much need for the
singular type classes. I'm still worried about having a few really
large interfaces but maybe there are some other patterns I haven't
encountered that can help with that.

Dave

headware@aol.com (headware) wrote in message news:<e3f4b0ae.0406152110.603a83ca@posting.google.com>...
> I'm helping to design a 3-tiered architecture for the first time and
> we have an issue that we're looking for advice on.
>
> In our application, we work with a particular type of object a lot.
> For the sake of argument, let's say that we're writing an application
> that simply stores data about people. Logically you would think that a
> business tier class called Person would be called for. However, as we
> design things, it is seeming more and more like we don't need a class
> called Person but rather a class called People that lets you work with
> a single person or many people.
>
> For example if you want to have a DataGrid that displays all people
> living in California you would need a business layer class that had a
> method like "GetAllPeopleFromState(string state)". It doesn't make
> sense to have that method in a class called Person since it pertains
> to many people. For the same reasons, methods like
> "AddNewPerson(string name, int age, string phone)" would have to go in
> the People class and not in the Person class. Methods like
> "UpdatePerson(string SSN)" or "DeletePerson(string SSN)" could go into
> the Person class but then you have two classes that work on people
> type objects. That seems like bad design to me. We could go solely
> with the People class and nix the Person class but this also doesn't
> seem like good design since it doesn't really model the real world
> that well. Plus it tends towards having one giant class instead of
> more, smaller classes, which could hurt modularity and reuse. How do
> people normally deal with this issue?
>
> Thanks,
> Dave



Relevant Pages

  • Re: delegation vs. inheritance
    ... "variance encapsulation" argument we might create a "purely ... I see that kind of "technical design" happen ... that another way of the technicians taking over design. ... Then about design patterns you comment ...
    (comp.object)
  • Re: For Sean Pitman: Review of "Meaningful Information"
    ... They are just looking for something that humans have an higher ... human-like design is not easily detectable. ... that all simple patterns are the result of intelligent design. ... What is 'informational complexity'? ...
    (talk.origins)
  • Re: (OT) Giving up on science [Was: Giving Up on Leopard]
    ... As you may know, both the Hebrew and ... of design that cannot be accidental or just coincidence. ... mathematical patterns run through the entire Bible, ... When you subtract a multiple of 7 from a multiple of 7 ...
    (comp.sys.mac.system)
  • Re: John Conways game of Life and order from chaos
    ... mathematically proven to be gardens of eden. ... designed patterns), but if I recall you don't really have any IDers ... instructive to calculate the CSI of a Garden of Eden pattern or two and ... functional information is not the hallmark of design as ...
    (talk.origins)
  • Re: The structure of PHP/Web Application coding.
    ... From your mentioning of Design Patterns i assume you want to/are practicing OOP. ... Refactoring should start allmost immediately from the start of any project and is to be done so frequently that it comes close to being done "all te time". ... IMHO a framework is simply the outcome of applying the principles of XP over the development of several similar applications. ...
    (comp.lang.php)