|
Prev: Deriving - .NET example
Next: Polymorphism Downsides (was: what's the future of Object Oriented Programming)
From: frebe73 on 10 Sep 2006 10:43 > >> Common example: Your users come in two types, Guest and Premium. So you > >> store the boolean isPremium in the database, and then all over your > >> project, > >> from the data layer to the JavaScript, you write "if (isPremium) > >> (whatever} > >> else {whateverElse}" everywhere. > >> > >> You need polymorphic types there. You should instead have a user type > >> with > >> two sub-classes. User.whatever() will call one behavior for the Guests, > >> and > >> another for the Premiums. > > > > Is Guest/Premium the only way you need to classify users? > > Absolutely yes. That's the only criteria that gets OO'd. > > > What if you > > later find it that you need to have different functionality for > > domestic and international users? > > Uh, put their functionality into two subclasses with a parent class > HailsFrom? Give each Customer instance a delegating link to a HailsFrom > instance? Lets say we have a method processOrder and the behavior of this method depends both on the premium and domestic/international criteria. Where will we put the implementation? (I am not saying that subtyping and inheritence is a bad thing, I only trying to say that it is not very likely to be used a lot in enterprise (web) applications, as the OP already has found out). Fredrik Bertilsson http://frebe.php0h.com
From: Rick Elbers on 10 Sep 2006 12:41 Dear W, I think you are absolutely right. While every application model could be described in object terms, a lot of them dont need it. Quite a lot of money is invested an earned in essentially CREDO applications (CRUD + Overview). Those applications might as well be constructed using a good two-tier framework. If we, for instance, look at what objects do in most applicatons using NHibernate or another ORMapper you would be very willing to consider those "empty" objects more like the "cost" of development then having anything to do with what OO promisses us. Regards, Rick ps: A good two-tier framework is still not constructed imho. Even .net doesnt have for instance updatableViews. Op 8 Sep 2006 07:41:29 -0700 schreef "VV" <vvarghese3(a)gmail.com>: >I am interested in hearing everyone's opinion on what they think the >future is of Object Oriented programming. > >I have spend most of my career with object oriented concepts (12+ years >) but recently with AJAX and the free tools, I really wonder what the >future of OO is. > >I recently launched a business written completely with free tools like >php and AJAX. I worked hard to give everything a structure like we OO >programmers are so particular about but honestly there was minimal >dependence on OO. > >The extend of my reusability might have been include pages, constants >etc. > >Are many of you finding widespread use of OO in the web world? > >Vibi Varghese >www.problima.com >A place to bring problems >..and to get paid to solve them
From: Phlip on 10 Sep 2006 13:15 "Rick Elbers" <rick(a)elbers.org> wrote in message news:kpf8g2dad2nrrncp52ls8c97ot43vpc4kp(a)4ax.com... > Dear W, > > I think you are absolutely right. While every application model could > be described in object terms, a lot of them dont need it. Quite a lot > of money is invested an earned in essentially CREDO applications > (CRUD + Overview). Those applications might as well be constructed > using a good two-tier framework. If we, for instance, look at what > objects do in most applicatons using NHibernate or another ORMapper > you would be very willing to consider those "empty" objects more like > the "cost" of development then having anything to do with what OO > promisses us. That is an example why OO is not a "description" process. It's a system to make direct calls into indirect calls. That technique is useful in all situations where excess coupling should be replaced by extensibility. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!!
From: H. S. Lahman on 10 Sep 2006 14:51 Responding to Ram... >>[Apocryphal anecdote. A couple of years ago I saw an article in a >>journal where the author actually claimed the first markup language was >>invented in 1986. How soon they forget and repeat past mistakes. >>Markup and scripting languages were very much in vogue in the late '50s >>and '60s. But there was a reason why they were abandoned by the early >>'70s.] > > > Is there a source (preferably accessible via the Internet) > where I can learn more about this, with names or examples of > these languages and an explanation why they were abandoned? Not that I know of. Most online DBs weren't around prior to '84 and there hasn't been a lot of backfilling for earlier work. Having been there, though, I can provide some factoids. MLs were very popular for things like report generation where the formatting was handled by markups. I forget the acronyms but every computer vendor and a bunch of other people provided one. Scripting was also very popular, starting with OS Job Control Languages used in the card-deck-and-batch processing days. They were also widely used for initial interactive applications like online defect reporting systems for OSes like IBM's TSO. At one point they were so popular that an entire operating system -- Wylbur -- was constructed with scripts. Why were they abandoned? Maintainability. ************* There is nothing wrong with me that could not be cured by a capful of Drano. H. S. Lahman hsl(a)pathfindermda.com Pathfinder Solutions http://www.pathfindermda.com blog: http://pathfinderpeople.blogs.com/hslahman "Model-Based Translation: The Next Step in Agile Development". Email info(a)pathfindermda.com for your copy. Pathfinder is hiring: http://www.pathfindermda.com/about_us/careers_pos3.php. (888)OOA-PATH
From: Rick Elbers on 10 Sep 2006 15:36
Philip, Am I excused when I dont understand what in heavens name you talk about? Rick Op Sun, 10 Sep 2006 17:15:30 GMT schreef "Phlip" <phlipcpp(a)yahoo.com>: > >"Rick Elbers" <rick(a)elbers.org> wrote in message >news:kpf8g2dad2nrrncp52ls8c97ot43vpc4kp(a)4ax.com... >> Dear W, >> >> I think you are absolutely right. While every application model could >> be described in object terms, a lot of them dont need it. Quite a lot >> of money is invested an earned in essentially CREDO applications >> (CRUD + Overview). Those applications might as well be constructed >> using a good two-tier framework. If we, for instance, look at what >> objects do in most applicatons using NHibernate or another ORMapper >> you would be very willing to consider those "empty" objects more like >> the "cost" of development then having anything to do with what OO >> promisses us. > >That is an example why OO is not a "description" process. > >It's a system to make direct calls into indirect calls. That technique is >useful in all situations where excess coupling should be replaced by >extensibility. |