• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Piet Souris
  • Carey Brown
  • Stephan van Hulst
Bartenders:
  • Frits Walraven
  • fred rosenberger
  • salvin francis

Why reuse doesn't happen

 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems to be a common complaint that the promise of object reuse just hasn't paid off. I wonder what's your experience and why you think it is or isn't true.

I've seen some major business and political problems with reuse.

Not invented here. How can I trust your code? Who certifies the quality ... you or some central reuse board? I'd rather roll my own so at least I'm familiar with its problems.

Who will maintain it? If you invite me to reuse a piece of your code, how will you support me? You'll correct defects according to my priorities, not yours? You'll support future versions of the JRE, platforms, containers, etc? And you're paying for all that, right?

Will you guarantee that future versions won't break my application? Will you include me in all your testing and release planning?

What's my motivation to share with you? In some companies successful teams get the next project while others are broken up to do boring stuff. I might rather compete with you than share with you.

How do I even find reusable code? Maybe you have great stuff, but parts of the company operate in silos and their techies are not encouraged to work together. Is there a central repository or index?

Technically, the biggest hurdle I've seen is coupling. I can't use one component from your system without using the rest. We have an enterprise standard for workflow, but it's a commercial IMAGE and workflow system. If I don't do images, I still have to pay big licenses and do a ton of custom work to separate workflow. Or your business calculator that would really do me a lot of good drags along a configuration subsystem and a logging subsystem that conflict with mine. (Because it's using static methods that I can't override, by the way.)

Can I use your component but replace one bit of behavior? You can do that with *some* of mine by virtue of the pluggable behaviors and application assembler. Our workflow system has four parts: Queuing, Routing, Sequencing and Timing. You can reuse the ones that meet your needs and plug in replacements for those that don't. (The vendor made that possible, and we thank them very much!)

Hmmm, it's starting to sound like the technical hurdles to reuse are just inflexible design. I don't say "bad" design because it's not bad until we change the requirements to add "make it reusable". But if "reuse before build" is a business priority, then it's just plain bad.
[ January 03, 2005: Message edited by: Stan James ]
 
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Stan James:

Technically, the biggest hurdle I've seen is coupling.

I think that's the biggest problem. The Java collections library is probably one of the most reused chunks of code in the world. In contrast, most code is insufficiently clean and too tied in to the purpose for which it was written to be effectively reused in unrelated applications. If everyone would just code like Joshua Bloch did with the Java collections, we'd be in much better shape.

In the code base I'm currently working with, there's a database access layer that's clean and very well designed. It's really a joy to use, and people do use it when given a choice. Unfortunately, the person who wrote it has been turned into an architect, with the result that code like that doesn't get written any more. Other people who try to write reusable code often end up writing monsters that are more trouble to use than they are to reimplement.

The other big problem is finding the reusable code. Some real thought needs to be put into organization of the source code if there's going to be any hope of finding code that might be useful for reuse. But if cleanly reusable code is available, people will learn that it's worthwhile to put some time into finding it.
[ January 03, 2005: Message edited by: Warren Dew ]
 
Warren Dew
blacksmith
Posts: 1332
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On the other hand, given the response rate to this thread, maybe it's just that most people don't particularly think of reuse as a virtue....
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, with the number of diverse classes coming with the JDK, and the dozens of open source projects we are using at work, I'd say that reuse actually *is* happening. We even contribute something to those projects now and then.

Reuse inside a project also gets better. It takes a lot of design experience and discipline, though, because you need very well managed dependencies.

What I find to be most challenging is reuse between teams inside a company. We do have some common code base, where we put things that we think aren't project specific, but that simply doesn't suffice. As long as people aren't aware of what code the other team writes, they simply won't use it - and if they do, different requirements on stability/flexibility, quality (having to be able to release every day vs. every couple of months) and dependencies (having to be compatible to Java 1.3 vs. wanting to use the newest features) present high potential for conflict.

We are currently thinking about doing some cross-team pair programming to disperse the knowledge of what code can get reused, and to better the understanding for the needs of the other team. Time will tell how well that works.

Additionally, we are currently working on making some of our most usefull code open source, which will of course change our needs for versioning that code, too. Perhaps that also will have a positive effect on reuse inside the company.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Framework and platform reuse is definitely working out, but then again it always has. I worked with somebody who wanted to count the whole Smalltalk library as code reuse, which I thought was akin to bragging about reusing "if" a lot. I find reuse within a project works out well, too. It's nice to have a problem and realize the solution can be assembled out of existing parts. As I refactor my Wiki I find a handful of new bits replacing a larger number of old bits and it always brings a smile to say "hey, that thing already does this!"

A few years ago one of those book-writing big-lecture-fee gurus (forget who) suggested reuse will have some cost. It's likely that you'll have to enhance something a bit to make is fit new purposes. Reuse is cheaper than building, but not free.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I always wonder what kind of reuse people actually want or expect to happen. Do you really expect being able to build innovative products by just plugging together existing reusable components???

But let's just imagine that a team managed to develop such components. That team would be able to build solutions for its customers with an astonishing productivity, wouldn't it? Would they really give those components away so that others can reuse them???
 
author & internet detective
Posts: 40679
827
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"What I find to be most challenging is reuse between teams inside a company."
Ilja's point got me thinking.

At our company, we have a central place to list internally developed resuable components. Some are technical (JDBC wrappers, audit logging, MQ, ...) and others are business (business calendar, accounting components, ...) The main reason this works is that our department uses the same tools, versions of Java, etc. Once in a while there are issues when we need to upgrade at different times, but these are rare.

With documentation and a culture of reuse, knowing about a component isn't a problem. For us, the biggest issues have been support and packaging. The author of a component needs to support it for the whole department. We end up transfering budget units to the component developer so this doesn't become an obstacle. Packaging is harder to solve. If a component isn't written to be reusable, it isn't generally in a form that it can be used elsewhere.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One company that I worked for they actually did code reuse fairly well. However, they also mandated it as part of the development cycle. By this I mean that they would section of code and then put a team in charge of maintaining that code. The one example that I can remember was a security component to be used in J2EE web applications. This component was used by every team that created any form of web app. However, in order to accomplish this, the company created a team whos only job was to maintain the security component. There were other similar code reuse components that existed and for each a team existed to maintain that component.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ilja Preuss:
I always wonder what kind of reuse people actually want or expect to happen. Do you really expect being able to build innovative products by just plugging together existing reusable components???



That's indeed what the reuse gurus have been promising us for 20 years...

Of course it can't really happen without extensive glue code (which often comes to such amounts that it's faster to code everything from scratch, though you might code another reusable layer to plug components together), something the reuse gurus never mention.
 
What kind of corn soldier are you? And don't say "kernel" - that's only for this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic