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'm work on a simple blogging web application using Java and MySQL as the database backend.

I'm implementing the whole application using plain HTML and servlets.

I'm using a Java class with static methods that are called from within servlets to handle communicating with the database.

Is this a good design? Or what should I do instead?

share|improve this question
add comment

3 Answers

up vote 4 down vote accepted

Build it without regard to any design patterns. Use it for a while and try to add features that make your user experience better. When you run into trouble try to fix it and chances are in the process of adding features you will rediscover the MVC framework. The point I'm making is that design decisions are highly dependent on the scale and use case of your application and it's hard to make a value judgement on what constitutes good design without being aware of the use case for the application.

share|improve this answer
    
This is actually what I'm doing, whenever I try to add more feature, I end up redesigning my application, thank you :) –  Mahmoud Hossam Mar 15 '11 at 8:06
add comment

Do NOT retain database connections between requests. Do NOT use static methods in Java unless there's a very good reason for them (there rarely is), especially in web applications.

share|improve this answer
    
I'm using them for convenience (I don't have to instantiate the database class), what do you suggest I do? –  Mahmoud Hossam Mar 15 '11 at 6:47
add comment

You may find that implementation using HTML/PHP/MySQL would be easier... however unless you're doing this for experience I would recommend downloading the newest version of WordPress. Its fully developed, easy to install/maintain/modify and overall an amazing piece of development!

share|improve this answer
    
I'm doing this for experience, and I'm not interested in PHP at all, I know it's easier, but I don't plan on learning PHP for the time being, thanks anyway :) –  Mahmoud Hossam Mar 15 '11 at 6:45
add comment

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.