Skip to main content

All Questions

2 votes
4 answers
3k views

I wrote a class with "init" method. Should I call it from other class methods? Or leave it to the object user? (Code Design)

I have a java class with an init method. It's different from the constructor. The constructor just initializes the variables/fields. The init method connects to a database and performs some ...
joker's user avatar
  • 131
1 vote
1 answer
1k views

Improving a try/catch

I'm a python programmer trying to get to grips with Java's inflexibility; I'm trying to parse a date from a string into a Calendar object private Calendar parsedDate ( String dateString ) throws ...
ChrisW's user avatar
  • 121
84 votes
8 answers
73k views

Is modifying an incoming parameter an antipattern? [closed]

I am programming in Java, and I always make converters sort of like this: public OtherObject MyObject2OtherObject(MyObject mo){ ... Do the conversion return otherObject; } At the new ...
CsBalazsHungary's user avatar
4 votes
5 answers
13k views

Is it a good practice to wrap collection in Java? [closed]

I came across a snippet like this, and find it's over engineering. Is it a good practice? public class SchoolList extends ArrayList<School> { } public class School extends ArrayList<...
Truong Ha's user avatar
  • 149
4 votes
2 answers
1k views

When is it worthwhile to replace working mature code with frameworks+patterns

Intro/Question I fear that frameworks in many cases have become a fashion or trend and are being abused. In many ways people are sacrificing speed just because they want to keep up with every single ...
Menelaos's user avatar
  • 267
0 votes
1 answer
83 views

How to record/store edits?

In many programs and web apps (stack exchange included) the program is able to backtrack what edits where made to the piece. My issue is similar: I want to be able to store a "timeline" of edits, ...
sinθ's user avatar
  • 1,311
8 votes
2 answers
324 views

Low coupling processing big quantities of data

Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a Java batch application and I can't put all the data inside a data structure ...
Vitaly Olegovitch's user avatar