|
Prev: Use Case Point Estimation
Next: Association Class
From: Robert C. Martin on 10 Jun 2005 15:58 On 9 Jun 2005 21:46:53 -0700, "topmind" <topmind(a)technologist.com> wrote: >> You may investigate this by looking at the source code of this >> particular program. You can download it at www.fitnesse.org. > >I see things like socket examples. Yes, there are some of those too. There are LOTS and LOTS of examples. Some are technical, some are business. OO is useful for *all* kinds of software. >Regarding your wiki example, I actually wrote my own wiki about 5 >months ago. At first I decided to use files instead of a RDBMS for the >hell of it. But, I wanted to keep open the possibility of later >switching to a RDBMS. Interesting. We *didn't* think about keeping and RDBMS as an option. And yet we managed anyhow simply by isolating the storage mechanism behind polymorphic interfaces. >Thus, I considered the idea of a generic wrapper >around the "persistence mechanism" (cough). We needed that wrapper (which amounts to an interface, not a lot of code) just to keep the tests running fast. >But then I realized I had >to make it rather low level to deal with a lot of crud that RDMBS take >care of for me. Interesting, we didn't have to do that. We kept the interface above the level of and RDBM API, and refused to pollute the higher level code with such details. >I gave up the generic idea, tossed the wrappers, and >the code was smaller can cleaner. And bound to the RDBMS. If we had done that, our tests would be too slow, and we would have to ship the system to our users with some kind of RDBMS attached. >Things like *concurrency*, searching, and cross-referencing were made >pretty simple by the RDBMS. Granted. RDBMSs are very powerful. Sequestering that power behind interfaces is what allows a system to be portable and deployable in many different user environment. Such sequestering means that designers have to get creative about how to access the power of the RDBMS from the other side of the interface. >A generic interface that can handle 3 of >files, RDBMS, and RAM is going to be bloated and end up reinventing a >database more or less anyhow. I invite you to look at the code. That's not what happened. The interface is quite clean, and does not reinvent an RDB. >You essentientally wrapped away from >RDBMS by almost building a DBMS of your own. Not very good "reuse" if >you ask me. You might want to check your facts before you report them Mr. Isikoff. However, the point is not without some merit. For our purposes it was easy to create a simple file system storage mechanism. However, there are other systems where such segregation would not be worth doing. The fact that OO techniques help you to sequester certain subsystems does not mean that such sequestering is always a good idea. >RDBMS are more than just a "persistence mechanism". They are "attribute >managers", and if you know how to use them properly, they handle a lot >of grunt-work for you. Agreed. On the other hand, it would be a shame to use one when you don't need it. > >A RDBMS *is* an interface, by the way. Think about that long and hard. I have, and I shall again. An RDBMS is indeed an interface. ODBC and JDBC are *polymorphic* interfaces that bind your application to any particular RDBMS you are interested in. So if you are using ODBC or JDBC, you are using OO techniques to talk to your database. If you use COM or ActiveX, you are using OO techniques to talk to your components. ----- Robert C. Martin (Uncle Bob) | email: unclebob(a)objectmentor.com Object Mentor Inc. | blog: www.butunclebob.com The Agile Transition Experts | web: www.objectmentor.com 800-338-6716 "The aim of science is not to open the door to infinite wisdom, but to set a limit to infinite error." -- Bertolt Brecht, Life of Galileo
From: topmind on 10 Jun 2005 16:01 Daniel keeps insulting me instead of present specific evidence that OO or poly is "better", and *I* get called a "troll"?
From: Robert C. Martin on 10 Jun 2005 16:02 On 10 Jun 2005 01:18:52 -0700, "Rob Thorpe" <robert.thorpe(a)antenova.com> wrote: >Phlip wrote: >> Rob Thorpe wrote: >> >> > What you've written above gives a basis for understanding the problem. >> > But you've missed an important part, to have an object-orientated >> > program you need data and subroutines connected together in some entity >> > called an "object" or "class" depending on the terminology. >> >> "I can identify Encapsulation and Inheritance as aspects of the 'leverage' >> term in my definition. They help make fOO integral to a system." > >My point is, it is not necessary to have polymorphism, inheritance or >jump tables to bind code and data into an object. All that is >necessary is that the two things are presented together. Granted. However, without polymorphism, I would not consider that OO. I would consider that to be "Object Based". ----- Robert C. Martin (Uncle Bob) | email: unclebob(a)objectmentor.com Object Mentor Inc. | blog: www.butunclebob.com The Agile Transition Experts | web: www.objectmentor.com 800-338-6716 "The aim of science is not to open the door to infinite wisdom, but to set a limit to infinite error." -- Bertolt Brecht, Life of Galileo
From: Robert C. Martin on 10 Jun 2005 16:03 On Fri, 10 Jun 2005 10:44:42 +0200, "Dmitry A. Kazakov" <mailbox(a)dmitry-kazakov.de> wrote: >On Thu, 09 Jun 2005 16:13:48 -0500, Robert C. Martin wrote: > >> I don't think so. Polymorphism is the ability for an object to >> respond to a message in a manner that is consistent with it's type. > >Isn't it rather strong typing? OO languages are strongly typed, even if they aren't statically typed. >Ooch. Can a goal of software design/structuring/etc be "calling functions >through jump tables"? You belittle OO! (:-)) One cannot belittle something by describing it in detail. ----- Robert C. Martin (Uncle Bob) | email: unclebob(a)objectmentor.com Object Mentor Inc. | blog: www.butunclebob.com The Agile Transition Experts | web: www.objectmentor.com 800-338-6716 "The aim of science is not to open the door to infinite wisdom, but to set a limit to infinite error." -- Bertolt Brecht, Life of Galileo
From: topmind on 10 Jun 2005 16:04
> Agreed, and you'll find plenty of examples of systems like that in my > articles and books. Are there any web-available articles that are not device-drivers or systems software? > You will expose it as a useful technique for managing dependencies. Well, I will agree that for certain things under certain conditions it will improve dependency management. Almost all paradigms and techniques have at least a few areas where they do well. But, those areas are fairly narrow in my opinion. -T- |