Tagged Questions

3
votes
3answers
114 views

Is JavaBeans a good example of encapsulation?

I'm trying to understand if JavaBeans is a good example of encapsulation. In my view, it's not as usually all the internal state is exposed through getters and setters. A simple example is public ...
7
votes
3answers
353 views

Which is a better practice - helper methods as instance or static?

This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well. Anyway, ...
1
vote
3answers
170 views

what are your web application server side layering design rules and the best practices you like to apply?

A web application is often designed to be layered. Typically there would be a Repository (Dao) layer, a Service layer and a Control (web handling) layer. The Control layer uses the Service layer which ...
3
votes
4answers
263 views

Proper OO design for State and Command

I'm working (a bit) on a (turn-based strategy) game. There are two classes relevant for the question: State: This is an immutable class, which exposes all its fields (either via getters or another ...
2
votes
1answer
46 views

Into which artifact does one package intermediate classes?

We have modularized our API into some independent components. Independent meaning these can be built via Maven and used as dependencies for other projects such as webapps. Now, to use this API, ...
5
votes
5answers
218 views

Object-Oriented Class Design

I was wondering about good object oriented class design. In particular, I have a hard time deciding between these options: static vs instance method method with no parameters or return value vs ...
1
vote
3answers
84 views

Design principles - data conformance / business logic in the data access layer?

I'm working on a small webservices project (java, axis2..). There is a lot of existing code, the code is divided into many layers, from the first layer where the request in interpreted to a few layers ...
2
votes
2answers
147 views

Design question: Is this good case for proxy pattern, or “over done”?

Working on a major enhancement for legacy code, I have been wrestling with myself over whether this is a good case to use the Proxy pattern, and more specifically whether a good case to use the Java ...
30
votes
4answers
402 views

Why were Java collections implemented with “optional methods” in the interface?

During my first implementation extending the Java collection framework, I was quite surprised to see that the collection interface contains methods declared as optional. The implementer is expected ...
4
votes
3answers
260 views

What is good programming practice for structuring java project?

I have a Java project that is getting to be relatively large (a few thousand lines in all, I'd say). It's definitely a lot larger than what I've dealt with before, being that I am still a relatively ...
4
votes
2answers
122 views

Implementation of communication between packages (Java)

I'm making a project with 5 packages. The packages can communicate with each other by sending Messages to a central MessageQueue in the Main package and that MessageQueue takes care of all the ...
1
vote
2answers
168 views

What are the best patterns/designs for stateful API development?

I am about to implement a API for my TCP/IP server written in Java. Right now I have a temporary method that takes a String, executes a command based on the String and returns a String basically like ...
6
votes
6answers
571 views

Are Java's public fields just a tragic historical design flaw at this point?

It seems to be Java orthodoxy at this point that one should basically never use public fields for object state. (I don't necessarily agree, but that's not relevant to my question.) Given that, would ...
0
votes
1answer
121 views

How to …set up new Java environment - largely interfaces

Looks like I need to setup a new Java environment for some interfaces we need to build. Say our system is X and we need to interfaces to systems A, B and C. Then we will be writing interfaces X-A, ...
0
votes
1answer
34 views

Where to put profile test?

I have an application with multiple threads that may be run on different hardware. To assist with tuning on different hardware I would like to create a "profiler" that can automatically run a fixed ...

1 2
15 30 50 per page