Java – Creating a Java project without using any objects and just calling static methods on input

coding-stylejavaobject-orientedstatic

I'm creating a program which takes a document, extracts it, and then moves this into a database. I've done most of this now and I've realised that I haven't made any instances of classes I've made (I have made instances of other thing such as buffered readers and arrays etc).

Is this bad? I seem to just have classes which are a collection of related methods which are called statically to manipulate my data (which is stored as a string) until it is then added to a database. How would an experienced programmer go about this if my technique is considered naive or bad form?

Best Answer

For this particular problem, it's not terrible. What you're doing is basically scripting an import process, which is a fairly straight-forward imperative problem. Java maybe isn't the best tool for that job, but it's fine.

An experienced programmer might create an intermediary data structure to represent the data going into the database to help should that ever come from a different source than the file. They might abstract away the file or database so you can have different import/output targets. But that might also be over-engineering depending on your environment and needs.