Skip to main content

All Questions

8votes
2answers
324views

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
7votes
3answers
384views

When module calling gets ugly

Has this ever happened to you? You've got a suite of well designed, single-responsibility modules, covered by unit tests. In any higher-level function you code, you are (95% of the code) simply ...
Pete's user avatar
  • 736
5votes
2answers
8kviews

Design pattern for processing a huge CSV file -- Java

I am learning design patterns in Java and also working on a problem where I need to handle huge number of requests streaming into my program from a huge CSV file on the disk. Each CSV line is one ...
Shad's user avatar
4votes
3answers
1kviews

Passing object or using the field

I would like to know what is a more appropriate way to code in Java. Is it generally better to pass entire objects in the method's parameters or just using the fields from the class? Using the field: ...
max's user avatar
  • 163
4votes
3answers
4kviews

What is the preferred access modifier for instance variables of a data transfer object?

I'm creating a data transfer object and can't decide whether it would be better to just give public access to the instance variables or if there would be a purpose to using getters and setters to ...
Korey Hinton's user avatar
4votes
2answers
1kviews

Can classes violate Single Responsibility if they delegate internal tasks?

I have two classes Output and Timeline, neither of which violate SR, but the two of them are linked together. So what I'd like to do is have a class called Elco (there's a reason behind the name) that ...
sinθ's user avatar
  • 1,311
4votes
2answers
5kviews

How to delete an object when other things reference it (and not making the code full of inter-dependencies)

The situation: In my program, there are a list of cues. To call a cue at a certain time, there are objects called Triggers. Cues have many public methods that allow them, among other things, to be "...
sinθ's user avatar
  • 1,311
4votes
2answers
194views

Should I write a wrapper within a manager object?

I have three classes that work together to do one function (from the perspective of the rest of my program). There is a little bit of set up between them, so, to make it easier for the rest of my ...
sinθ's user avatar
  • 1,311
3votes
4answers
780views

Is it a bad practice to have an interface method to tell whether it can handle an object?

interface Resolver { boolean canResolve(SomeInput input); SomeOutput resolve(SomeInput input); } public static void main(String[] args) { List<Resolver> resolvers = ...; ...
Martin Tarjányi's user avatar
3votes
2answers
2kviews

Lazy Processing of Streams

I have the following problem scenario: I have a text file and I have to read it and split it into lines. Some lines might need to be dropped (according to criteria that are not fixed). The lines that ...
Giorgio's user avatar
  • 19.8k
3votes
2answers
3kviews

Using MVC style, where is the best place to put SQL functionality?

I am wondering about best practices here. MVC (Model - View - Controller) patterns involve separating components of your program that model the data, manipulate those models, and display those ...
AJJ's user avatar
  • 3,028
3votes
2answers
207views

Checking the user in almost all use cases

I have a web application that has Users that belong to Companies. A User can only belong to 1 Company at a time and they can manage their own company information. I'm using java spring and I'm ...
Jordi Pagès's user avatar
3votes
3answers
2kviews

Parallel Class/Interface Hierarchy with the Facade Design Pattern?

About a third of my code is wrapped inside a Facade class. Note that this isn't a "God" class, but actually represents a single thing (called a Line). Naturally, it delegates responsibilities to the ...
sinθ's user avatar
  • 1,311
3votes
1answer
540views

Contract interface/class with inner classes/interfaces

Brief description of my project structure. I have some base classes like BaseView, BasePresenter ... . Also my project consists of modules, module represents one complete part of the application. ...
CROSP's user avatar
  • 1,558
2votes
3answers
205views

Data duplication, can it be an unavoidable practice in this example?

Say I have different employees of type Employee stored in a list inside a class SubCase. public class SubCase{ protected ArrayList<Employee> employees; ... } SubCase represents a part ...
CedricCornelis's user avatar

153050per page
close