|
Hi Gregg, You're right of course; there are several ways to do this. My point was not which sort of get Address() you would use. My point was bigger picture illustrated by this example. In the real world envelopes are not active at all. I don't ask an enveloped to give me an address. An envelope really doesn't have any "methods" or operations. It is inanimate. Keith was originally talking about modeling on "real life". But OO techniques don't always do this. A person reads the envelope (some machines do too). A person puts the address on an envelope (some machines do too). An envelope doesn't do this itself. Therefore an envelope would look more like a class with no methods (or a structure) and all the address information would be publicly accessible. A person or machine would be able to "get address" from an envelope. However most OO methodologies would put the method on the envelope because the person (or Customer object etc.) would get bloated if all the operations/methods for all inanimate objects in the system were put in the person object itself. So my point was not about the various ways of doing getAddress() on an envelope but was on the fact that anything like it would be on an envelope in the first place if OO is truly modeling the real world. In OO we often don't model it exactly and actually encourage some practices that aren't "real world". But you are of course right. Once you cross the line, that it's okay to put these operations on inanimate objects, then there are different ways to do this - some more appropriate than others. Your example was good. I'm sure there are other examples where OO techniques don't always model the real world. Does this mean that OO is bad? Not at all. I love programming in OO. But does that mean it is suitable for all programming scenarios? Not necessarily. And consider this. Ask a business person what happens an purchase order. Sure they might very well describe objects involved in the process but they will describe a process or procedure that the order must got through in order for it to be fulfilled. And this process or procedure might merely mean that the order moves from department to department getting examined and augmented and having other pieces of information attached or generated as a result. This might just as easily be modeled and developed in a procedural model. E.g. A form (or structure) moving from process to process etc. Regards, William On Oct 8, 2006, at 7:12 AM, Gregg Wonderly wrote:
|
- Re: [service-orientated-architecture] Re: Keith o... Eric Newcomer
- Re: [service-orientated-architecture] Re: Ke... Keith Harrison-Broninski
- Re: [service-orientated-architecture] Re... Steve Jones
- Re: [service-orientated-architecture] Re... William Henry
- Re: [service-orientated-architecture... Gregg Wonderly
- Re: [service-orientated-architec... William Henry
- Re: [service-orientated-arc... Gregg Wonderly
- Re: [service-orientated... sanaz
- Re: [service-orient... Keith Harrison-Broninski
- [service-orientated-architecture] Re... Semih Cetin
- Re: [service-orientated-architec... Gregg Wonderly
- Re: [service-orientated-architec... Stefan Tilkov
- Re: [service-orientated-arc... Gregg Wonderly
- Re: [service-orientated-architecture] Re: Ke... Gregg Wonderly
- Re: [service-orientated-architecture] Re: Ke... Eric Newcomer
- Re: [service-orientated-architecture] Re... Keith Harrison-Broninski
