2

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?

3 Answers 3

4

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.

1
  • This is actually what I'm doing, whenever I try to add more feature, I end up redesigning my application, thank you :) Commented Mar 15, 2011 at 8:06
1

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.

1
  • I'm using them for convenience (I don't have to instantiate the database class), what do you suggest I do? Commented Mar 15, 2011 at 6:47
0

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!

1
  • 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 :) Commented Mar 15, 2011 at 6:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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