The Artima Developer Community
Sponsored Link

Java Buzz Forum
Programming with Adaptors

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Carlos Perez

Posts: 153
Nickname: ceperez
Registered: Jan, 2003

Carlos Perez is a Software Architect with over 10 years of industry experience
Programming with Adaptors Posted: Jun 30, 2003 4:56 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Carlos Perez.
Original Post: Programming with Adaptors
Feed Title: .:Manageability:.
Feed URL: http://www.manageability.org/blog/stuff/rssDisabled?portal_status_message=Syndication+is+Disabled
Feed Description: Random thoughts on the manageability of complex software.
Latest Java Buzz Posts
Latest Java Buzz Posts by Carlos Perez
Latest Posts From .:Manageability:.

Advertisement

"Programming with Adaptors" a new term I'm making up.  It's really nothing new, but recently it's being taken to new levels. 

Exhibit A, Spin:

We will present our project named Spin which offers a - to our knowledge - revolutionary new approach. It offers transparent thread handling with minimal impact on your application code.

Exhibit B, PyProtocols

Do you hate having to write lots of if-then logic to test what type something is?  Wouldn't it be nice if you could just declare "I want this object to have this behavior" and magically convert whatever value you have, to the type you need?  PyProtocols lets you do just that, cleanly, quickly, and robustly -- even with built-in types or other people's classes.

Spin is somewhat similar to the interceptor based approached to AOP, however it adds an adaptor to respond to events that makes it worthy of more indepth study.

PyProtocols, well this is something you really have to dig in deep. Here are some of its features:

  • Specify what behavior a component requires or provides
  • Specify how to adapt the interface provided by one component to that required by another
  • Specify how to adapt objects of a particular type or class (even built-in types) to a particular required interface
  • Automatically adapt a supplied object to a required interface, and
  • Do all of the above, even when the components or frameworks involved were not written to take advantage of this package, and even if the frameworks have different mechanisms for defining interfaces.

Now if you reflect a bit, you realize that a lot of menial work in programming covers the transformation of one type into another.  It's just embarassing the amount of time spent doing this kind of activity. It makes so obvious the limits of Object Oriented resusability. 

The reasons are also so obvious.  If you continue to develop objects with different kinds of methods.  Then you'll continue to need to write an adaptor that transforms one object to another, at worse the amount of progamming is like O(n^2).  So we can either not define any new kinds of objects (or more precisely interfaces) or we can make programming adaptors much easier.   

Read: Programming with Adaptors

Topic: Crtical View of JavaOne2003-DW-IBM Previous Topic   Next Topic Topic: J2ME Tutorials

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use