Java is a high-level, platform-independent, object-oriented programming language originally developed by Sun Microsystems. Java is currently owned by Oracle, which purchased Sun in 2010.

learn more… | top users | synonyms

3
votes
1answer
1k views

How to read from a database, and write to a file asynchronously / non blocking way in Java

I'm trying to modify a serial program that reads from a database, and writes results to a file, this is done in a blocking way and I think we can get performance boost of there is a memory buffer and ...
9
votes
6answers
663 views

Is there an infinite amount of knowledge in a programming language?

I can program in Java, C#, C, Scala, and Javascript fluently. I'm comfortable with Objective-C, but I don't remember the conventions used for memory management. I can read Python and Ruby and I've ...
14
votes
10answers
5k views

Understanding already existing complex code base [duplicate]

Possible Duplicate: What is the most effective way to add functionality to unfamiliar, structurally unsound code? Till now, all I have worked on is with Java projects that I build from ...
2
votes
2answers
576 views

MVC: View-Controller Interaction

I have a Java application that I am implementing following the MVC pattern. I want to have a window (view) that contains a form which allows the user to add several text fields. There will also be a ...
5
votes
2answers
496 views

Explaining how the code you wrote works

I was asked to create for a freelance project a Monopoly game in Java. After finishing it the same guy asked me to create four UML diagrams from which he could understand how the game works. ...
26
votes
5answers
2k views

Is use of finally clause for doing work after return bad style/dangerous?

As part of writing an Iterator, I found myself writing the following piece of code (stripping error handling) public T next() { try { return next; } finally { next = ...
-4
votes
4answers
550 views

Are Java developers becoming less important as JVM/JIT capabilities grow? [closed]

(I am asking this from a low latency perspective, but I guess the question applies in normal business domains). I am deciding whether to try and specialise in C++ or Java for low latency. My issue ...
1
vote
1answer
433 views

MVC, Java Design Pratices, and Flaws of java.util.Observable and java.util.Observer

I am planning learning Model-View-Controller (MVC) development using Java. While reading I came across a post which mentions java.util.Observer and java.util.Observable for MVC development. As I ...
-1
votes
1answer
410 views

Method size in an OOP language, for instance - in Java [duplicate]

Possible Duplicate: What should be the maximum length of function In Java (and I think in other OOP languages too) it is recommended to keep class methods as short as possible. While I ...
41
votes
6answers
5k views

How to deal with static utility classes when designing for testability

We are trying to design our system to be testable and in most parts developed using TDD. Currently we are trying to solve the following problem: In various places it is necessary for us to use static ...
2
votes
3answers
7k views

Is C# more superior than Java as a programming language, objectively speaking? [closed]

A colleague (a .NET fan) argued that (in context to Java vs .NET comparison), while there are different arguments for Java and for .NET, and to determine which one is the better choice is a business ...
0
votes
3answers
375 views

API design and versioning using EJB

I have an API that is EJB based (i.e. there are remote interfaces defined) that most of the clients use. As the client base grows there are issues with updates to the API and forcing clients to have ...
5
votes
3answers
184 views

When is 'cloning', rather than reusing, a module acceptable design solution?

For this question, I'll give an example module to facilitate the discussion, Let's say the module is a calculation engine, It currently servers its purpose for its current audience. The requirement is ...
6
votes
2answers
759 views

What is the alternative to an enterprise portal strategy in the Java space?

So, I got my wrist slapped by asking this question over on StackOverflow. I guess the previous iteration of the question was not one that gets resolved with a concise enough answer - hopefully some of ...
1
vote
1answer
518 views

Effective programming of data layer management/access

Short Version: What is the term/concept which describes the efficient design of programming the data layer for efficient data access and what are some sources/books/articles/website which discuss this ...
15
votes
6answers
3k views

Efficient try / catch block usage?

Should catch blocks be used for writing logic i.e. handle flow control etc? Or just for throwing exceptions? Does it effect efficiency or maintainability of code? What are the side effects (if there ...
1
vote
1answer
933 views

What toolkit to use for card game? [closed]

I'm new at this and I was wondering if someone could suggest the most appropriate API to use to make a card game that is: cross-platform two-player peer-to-peer capable of laying out cards (png ...
12
votes
5answers
4k views

Should a string constant be defined if it's only going to be used once?

We're implementing an adapter for Jaxen (an XPath library for Java) that allows us to use XPath to access the data model of our application. This is done by implementing classes which map strings ...
11
votes
4answers
9k views

REST vs RESTful vs “normal” web service - the same or not?

I've read a couple of definitions and discussion on REST and/or RESTful applications, but I still do not understand the real meaning of it. I usually work with the apps which either fetch data via ...
21
votes
11answers
2k views

Should I use a code repository if I am the only one working on a project? [duplicate]

Possible Duplicate: Version control for independent developers? I am not sure if I should use a code repository when I am the only one working on a project.
4
votes
1answer
6k views

Where to put Spring configuration file?

I want to integrate Spring framework in my project especially into server side. So, I don't want to put it within WEB-INF folder of war file. Should I put an applicationContext.xml it into each ...
4
votes
4answers
1k views

Advice on which technologies to use for a client-server desktop application

I am writing a desktop application in Java which will allow clients to authenticate to a server with their credentials, and afterwards view and manipulate some data (orders, invoices, employees etc.) ...
10
votes
4answers
5k views

How can I monitor the JVM memory in a proper way?

I'm thinking of how we do JVM memory monitor in a low overhead way in production environment even under busy hour. Suppose I have two tomcat app server in production, load balance set up behind them. ...
3
votes
1answer
204 views

Architectural considerations for a new black box program

I see an emerging trend in "cloud" computing to move work load to a third-party server and get charged pennies for amount of work done in this way. This could be anything from file hosting to user ...
14
votes
2answers
570 views

Should You Log From Library Code?

If I am developing a Java library, is it good practice to issue log statements from within the library's code? Having logging within the library will make debugging and troubleshooting more ...
2
votes
2answers
336 views

How would you transfer data between your data structures and databases?

I'm learning programming in school and I have this question that's bugging me about data structures and transferring the information stored inside them to databases. We're doing just small systems - ...
0
votes
2answers
398 views

Common test cases for XML schema validator

I just wrote my first SAX-based (Java) XML schema validator, where you pass it a schema URL (pointing to the .xsd file), and an XML instance, and it determines whether or not that instance is valid or ...
6
votes
8answers
3k views

How to answer to this HashTable interview question?

Today I was asked this question during an interview: What's gonna happen if we do not override hashcode method for our class, then add it to HashTable and then try to get objects? Could you ...
5
votes
6answers
493 views

Is there any reason in a Java program for a special naming for a function arguments?

I'd like to know, why would I want to have a special prefixes for a function arguments, like "p_name", "p_age", "p_sex"? On the one hand it helps to distinguish parameter from local variable or field ...
0
votes
1answer
309 views

force recompilation of war file including its Jar dependencies

I have a project A (a webapp), depending on project B (B.jar) and this one depending on project C (C.jar). I would like to create a maven goal named "Rebuild War", that clean all compiled code for ...
3
votes
1answer
2k views

IntelliJ with Maven compilation

I have a project that needs Hibernate jars. I added them as dependencies in the pom.xml and Maven compiles my project well. However, in the IDE, all annotations and calls to Hibernate API are marked ...
3
votes
2answers
588 views

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 ...
1
vote
2answers
2k views

What is sequential code execution?

I have been looking around on the internet and have not found a good answer yet. If anyone could be so kind and supply a code sample I would greatly appreciate it. I apologize for the simplicity of ...
1
vote
2answers
1k views

Designing complex query builders in java/jpa/hibernate

I need to build complex sql queries programatically, based on large filter conditions. For example, below are few sample/hypothitical filter conditions, based on which i need to fetch users Country: ...
3
votes
2answers
883 views

Anyone know about AppDynamics? Does Microsoft already have something similiar? Event viewer? Im confused

We have a big collection of java (80%) and .Net (20%) apps.. And the people in charge want a way to monitor the applications somehow. So they told me they are interested in AppDynamics? I have spent ...
3
votes
3answers
804 views

Designing an API on top with Java RMI and Rest APIs

I'm working on the backend of a java web application. We have a document repository (Fedora Commons specifically) where we house xml files. I want to abstract the API of the repository internally so ...
4
votes
1answer
434 views

Text comparison algorithm using java-diff-utils

One of the features in our project is to implement a comparison algorithm between two versions of text and provide a % change between the two versions. While I was researching, I came across google ...
1
vote
4answers
5k views

How to gain Professional Experience in Java/Java EE Development [closed]

I have been seeing opportunities go past me for just 1 reason: not having professional industry experience. I say to many employers that I'm capable of doing the job and show them the work I've done ...
1
vote
2answers
839 views

How to pass around a debug flag variable?

I need to generate debug output in a java appliation that cannot be debugged by placing break points and traces. I've thus far been placing the debug flag as a static variable in one of the classes ...
2
votes
1answer
468 views

Java Application for handling records(CRUD)

I am new to JavaEE and am faced with a tight situation here. I have to develop a Java application for (CRUD) handling records and saving and loading an XML concerning that record. Obviously, I won't ...
1
vote
2answers
443 views

Submitting Java Code with Junit unit test

I have mostly worked on simple java programs and compiled and run them with Eclipse on Windows. So, I have no experience of using command prompt for compiling Java projects and do not have much info ...
2
votes
1answer
156 views

What are the design decisions involved in choosing how to expose a Java web application?

There are many ways to expose a Java web application to the consumer: application container (JBoss etc), servlet container (Tomcat etc), OSGi (Knopflerfish etc), self-executable WAR (Winstone etc) and ...
8
votes
2answers
252 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 ...
3
votes
2answers
918 views

OOP - Composition, Components and Composites Example?

I've been reading a bit about OOP in relation to Composition, Components and Composites. I believe I understand the fundamental principle (not sure). Can someone please provide a code example of a ...
0
votes
2answers
124 views

Java - multirow array

Here is my situation: a company has x number of employees and x number of machines. When someone is sick, the program have to give the best possible solution of people on the machines. But the ...
2
votes
1answer
159 views

Separating model from UI

I have a Swing application with a custom TreeModel that can refer to domain instances. I'm wondering what changes I could make if I consider moving to a web interface later on. Would a pluggable model ...
-1
votes
0answers
48 views

Best way to handle product and supplier relationship [duplicate]

Possible Duplicate: best way to handle a many to many relationship? The relationship between product and supplier is many to many with a new class to be created? Or is it many to 1?
3
votes
1answer
314 views

Difference between Javabean and Java Beans

I'm confused. I've seen two different terms: Javabean and Java Beans. Is there a significant difference between them?
4
votes
2answers
259 views

Can the overuse of custom taglibs disrupt the outsourcing of html designers?

Yesterday me and a friend were talking about the overuse of custom taglibs. We create taglibs for everything. We create taglibs in order to wrap jQuery UI elements (tabs, button, etc), and other ...
14
votes
2answers
9k views

Writing low latency Java [closed]

Are there any Java-specific techniques (things which wouldnt apply to C++) for writing low latency code, in Java? I often see Java low latency roles and they ask for experience writing low latency ...