views:

130

answers:

4

We have an existing "legacy" app written in C++/powerbuilder running on Unix with it's own Sybase databases. For complex organizational(existing apps have to go through lot of red-tape to be modified) and code reasons(no re-factoring has been done in yrs so the code is spaghetti), so it's difficult to get modifications done to this application. Hence I am considering writing a new modern, maybe grails, based web app to do some "admin" type things directly into the database. For example to add users, or to add "constraint rows".

What does the software community think of this approach of doing a run-around of the existing app like this? Good idea? Tips and hints?

+2  A: 

Good idea? No.

Sometimes necessary? Yes.

Living in a world where you sometimes have to do things you know aren't a good idea? Priceless.

In general, you should always follow best practices. For everything else, there's kludges.

MarkusQ
In theory, theory and practice are the same. In practice, they aren't.
Paul Tomblin
+1 for witty answer
greyfade
Could you elaborate on the "sometimes"...ie when would you do it?
Ville M
One shot thing, sure (though for that I'd go straight SQL). New facing (e.g. a grails web interface for an app that has none, sure). Where I _wouldn't_ is long term direct but partial replacement (e.g. in the same use scope)--anything where you're going to "compete" with the existing app.
MarkusQ
+2  A: 

See this, from Joel, first!

Update: I had somewhat misconstrued the question and thought that more was being rewritten.

My perspective on your suggested "utility" system is not nearly so reserved as would be suggested by my link to Joel's article. Indeed, I would heartily recommend that you take this approach for a number of reasons.

First, this may well be the fastest route to your desired outcome since the old code is so difficult to work with.

Second, this gives you experience with a new development technology and does so in the context of your existing work - this is a real advantage.

Third, I took this approach years ago when transitioning an application from C++ to Delphi. In time, the Delphi app grew to be so capable that a complete leap onto that platform became possible. At no point were users without the functionality that they already knew because the old app wasn't phased out until the replacement functionality had been proven. However, it is at this stage that you'll want to heed Joel's warnings: remember that some of the "messiness" you see is actually knowledge embodied in the old code.

Mark Brittingham
I have read that article before, however this is not a rewrite at all so it doesn't really help to answer my quesion, sidecar is an excellent analogy from the comments above. I basically want to add admin functionality in a new technology, everything except the database that it.
Ville M
Ville - please accept my apologies. When I first read your question I thought that you were suggesting a rewrite of more of the core code. See my updated answer as well.
Mark Brittingham
Thanks for the additional comments, very helpful, +1
Ville M
Thanks! I appreciate the revisit.
Mark Brittingham
+3  A: 

There is always a debate between a single monolithic app and several more focused apps. I don't think it's necessarily a bad idea to separate things - you make things more modular, reduce dependecies, etc.. The thing to avoid is duplication of functionality. If you split off an adminstration app separately, make sure to remove that functionality from the old app, or else you will have an unmaintained set of adminstration tools that will likely come back to haunt you.

Eclipse
"If you split off an adminstration app separately, make sure to remove that functionality from the old app", an excellent point. +1
Ville M
+2  A: 

Good idea? That depends on how well the database is documented and/or understood. Make a mistake about some implicit application-level implemented rule, relation, or constraint, and your legacy app may end up doing cartwheels down the aisle.

Take a hypothetical example. Let's say adding a user with the legacy system adds records to the following tables:

  • app_users
  • app_constraints
  • app_permissions
  • user_address

Let's assume you catch the first three, miss the fourth. It can't be important, right? But what if in the app, in the 50 places that app_users is used, one place does an inner join to user_address. (And why not? The app writer knew that he always wrote a record to user_address!) The newly added user suddenly disappears from the application's view, a condition that "could never happen" according to the original coder, and the application coughs up a hair ball. Orders can't be taken. Production stops. A VP puts his new cardiac bypass surgery to the test.

Who gets blamed? Not the long-gone developer who should have coded for more exceptions. Not the guys who set up the red tape to control change. The guy that did an end run around those controls.

Good luck,

Terry.

Terry