Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have been working with a complex system written with Java. It is made by with many java programs and many shell scripts which call them and some cronjobs to schedule them.

The system is hard to maintain. Input/Output/Error/OK files were distributed in different place of the system by the hands of different programmers. In order to know what is going on, I need to check the config file to see where are the relevant files, and go there to check the status of the program by viewing some logs or ok files(a blank file with extension of .ok to indicate the success of a scheduled job).

Moreover, I am tired of wasting my time on the JDBC connection/object which need to open explicitly and close explicitly.

I've heard that people's compliment over the famous Struts Spring Hibernate (SSH) frameworks. I have never touch any of those, would they help me make a better project which is easy to maintain?

share|improve this question
4  
Java frameworks serve a purpose, and *-Spring-Hibernate used correctly is a fairly safe choice for Java webapps (Struts 1 is long dead, btw, but Struts 2 is usable). That said, these frameworks themselves have gotten tremendously complex, so if you're not careful you'll just trade Spaghetti Bolognese for Spaghetti Carbonara. –  Barend Dec 8 '11 at 10:03

4 Answers 4

up vote 2 down vote accepted

I agree with @Martin in that you don't necessarily need frameworks to solve these problems. Although for greenfield development, it is indeed advisable to pick and use an established framework, in this specific case it seems to me that most of your problems stem from the general disorderliness and inconsistency of the system. Although a common, consistently used framework could indeed help consolidating your system and keeping it maintainable in the long run, the more important and urgent part is reorganizing your system to make it consistent and clean.

This can - and in fact, should - be done before migrating to a framework, because it involves a lot of decisions and preparations you would need to do before migrating to a framework anyway. However, this approach is much less obtrusive, thus less risky, than full scale migration. Altogether, it gives you the most return on your investment (effort spent).

Otherwise - by migrating to a framework directly - you risk expelling a tremendous effort and still having a system which may be slightly less disorderly and inconsistent - and in a different way than before -, but still hard to maintain.

So start by setting up common conventions for your project team ("this is where we put the output file for module X, and this is its expected format") and ensuring that everyone adheres to them, initially for new development. Once the conventions are discussed, shaken out, tried, tested and matured, you may gradually start to revise, rewrite and reconfigure existing scripts to adhere to them too. Once most of the system works according to the conventions, you may consider migrating to some framework.

share|improve this answer
    
Per the method described, "once the conventions are discussed, shaken out, tried, tested and mature" you might have developed your very own framework, no? –  perp Dec 8 '11 at 17:22
    
I wish I can clean it up too, but imagaine what will a boss said:"If the system is working, why bother? As long as you keep an eye on the system for us.". Usually a fairly big company have a kind of bureaucratism that every change to production would need approval from 4,5 managers. At least this is my case. –  lamwaiman1988 Dec 9 '11 at 3:57
    
@gunbuster363, if getting approval for fairly small and local changes to make the system more consistent is impossible, how probable is it to get approval for full migration to a new framework? To convince bosses, you need figures in hard cash. Calculate how much extra time (and potential errors) it costs you to administer the system as it is, compared to what it could be. Extra work time spent = money wasted by the company. Estimate the cost of a change and calculate how long it would take for the change to repay its price in simpler and safer administration. Present this to your managers. –  Péter Török Dec 9 '11 at 8:41

All things considered, in most cases and especially for common types of applications, you're better off using frameworks than not using them.

Frameworks (good ones, anyway) offer the following benefits:

  • They provide well-designed APIs for common tasks, and efficient, well-tested implementations that are much better that what most developers would come up with themselves, especially when new to a field.
  • They impose some structure/patterns on your code that have been shown to work well and make your code easier to understand, especially (but not only) to people who have used the same framework.

Learning to use a framework can be daunting, and most developers' cowboy coder instincts scream "I could do this so much better". Usually they're wrong - you're seeing the result.

But frameworks will not magically make your code maintainable - any tool can be misused to the point where it does more harm than good.

share|improve this answer

The answer is No. You do not need frameworks in order to work better. Some frameworks embody design patterns that could perhaps be usefully applied to a particular application.

So I'd look at whether a design pattern can be applied to your problem and then assess whether a framework will assist you or whether implementing the pattern yourself would be the better option.

Don't re-invent the wheel just for the sake of it, but also don't blindly apply frameworks, they have consequences and trade-offs like anything else.

share|improve this answer

I agree that your 1st duty is to consolidate/clean your code up to use a single place for files, common config files, consist status mechanisms.

Using a framework, without doing this 1st is not going to help. So do the clean up 1st and then re-evaluate your needs.

PS clean up is hard and slow. I spent 6-8 weeks clean up a system that had just been completed because the previous developers had not followed consistency etc rules.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.