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

1
vote
1answer
153 views

From a DDD perspective is a report generating service a domain service or an infrastructure service?

Let assume we have the following service whose responsibility is to generate Excel reports: class ExcelReportService{ public String generateReport(String fileFormatFilePath, ResultSet data){ ...
1
vote
1answer
74 views

Java Modal Object Design

This question is not about a specific program. This is about design - the UML phase of the project. I am supervising a Java project. It will contain a lot of modal popup dialogs. From a C/C++ ...
-1
votes
0answers
16 views

MVC Application Extension reusing the service / dao layers

I am about to start my own project spun off a greater Opensource project. I am trying to get my head around best practice, both in terms of application portability and stability. To explain: ...
-5
votes
0answers
23 views

how to remove threads in vector list container in java [on hold]

Enumeration e = v1.elements(); while(e.hasMoreElements()){ Serverthread stm = (Serverthread)e.nextElement(); stm.send(str); } Enumeration ex=names.elements(); int ...
3
votes
2answers
203 views

Best approach for multilingual Java Enum

I'm running into issues with an approach I am taking and am now wondering if I just started down the wrong path and should rethink my approach. Here is what I attempting. I would like to use an Enum ...
-4
votes
0answers
22 views

to implement connection pooling through jdbc using oracle databse,GETTING ERROR [on hold]

import java.util.Hashtable; import javax.naming.*; import javax.naming.directory.*; public class OracleDataSourceRegisterJNDI { public static void main(String[] args) { try { // Set up ...
1
vote
4answers
344 views

How to work around Java's lack of pointers to pointers when working with linked data structures? [on hold]

I've learned from a textbook how to implement binary search trees recursively in Java, and am working on implementing them nonrecursively. I've found a simple and elegant way to implement an insert ...
0
votes
1answer
122 views

When creating a library, is there a way to make certain classes entirely internal to the library, and not exposed to the user of the library?

Suppose you were designing a Java library for other people to use. You compile the library into a JAR that they can import into their projects and use. Needless to say, you intend for the library to ...
4
votes
7answers
4k views

Generating every combination of a 32 character alpha numeric string?

Is it possible to generate every possible combination of a 32 character alpha numeric string? If so, how long would it take on today's fast computers? My lecturer at university said it's impossible, ...
-7
votes
1answer
71 views

ArrayList stores only 64493 entries [on hold]

I am reading from a file that has 128985 entries (simple English words list, LF delimited entries). I am using the below code to read from the file and store the words in an ArrayList. import ...
-2
votes
0answers
35 views

JOGL2 command line [migrated]

I have the latest version of Java and JOGL2 installed. After experimenting, I want to compile and run the most basic JOGL2 program possible. I have: import javax.media.opengl.awt.GLCanvas; public ...
-5
votes
2answers
85 views

Run java program without compiler or an IDE [on hold]

I wanted to give a friend for Christmas a Java program to run. The person cannot program at all, so I would be surprised if he had any standard tools for programming. I know that there are some web ...
-3
votes
0answers
65 views

Unable to declare Java Constants as static [migrated]

I am getting error-"Illegal modifier for parameter DEFAULT_CATALOG, only final is permitted" in below (Bold part), Why I am not able to declare constant as static. Instead of directly using variable ...
0
votes
2answers
65 views

How to connect Android App to MongoDB deployed on Google Cloud

Currently I am working on a simple app which will be able to connect to MongoDB which is deployed in Google Cloud. I have set it up MongoDB ocaly on my computer and I have made a little JAVA console ...
0
votes
1answer
198 views

When should a class be final? [duplicate]

I've only really seen this on Java's wrapper classes (String, Integer, etc.), but never in open-source projects, and I was never taught about it in any books or classes. I know it means the class ...
-5
votes
0answers
29 views

Java socket file and chat program [on hold]

I have write a chat program and a file transfer program. Both of these programs connects with Java Socket and I was just asking, can I combine those? Because when I was learning how to transfer file's ...
0
votes
1answer
288 views

HTTP Session: A single object or multiple?

I tested two approaches to store session data: The classic: 1 key, 1 object (And every key as static final String in a class) "user" --> UserObject "preferences" --> List ... An ...
-4
votes
0answers
42 views

Best books for learning JIRA programming and development [on hold]

Any ideas on how to best learn to program JIRA apps, plugins, etc. other than the JIRA documentation (which is good)? In other words, how does one become proficient with JIRA (which uses Java and can ...
0
votes
1answer
103 views

Reflective discovery of an inner class in an API

Let me ask you, as this bothers me for quite a while but appears to be subjectively the best solution for my problem, if reflective discovery of an inner class for API purposes is that bad idea? ...
-1
votes
1answer
768 views

Building a Java CMS - What Existing Product Should I Use? [on hold]

I'm a Java developer and in need of a CMS. I've spent a lot of time reading about, and tinkering with Liferay but am concerned that it doesn't cover two of my three major concerns I need to have ...
0
votes
1answer
264 views

What is the traditional way to maintain extensibility in a database-driven application like this?

I'm working on a simple application for a game in Java that allows a user to record whether they have collected a given item and how much experience it contains. This will work for multiple item types ...
5
votes
1answer
686 views

Attachment handling for web application with Jackrabbit

I need to manage attachments on my Spring web application and I thought to use an open source repository. My app it's a job approval system using J2EE / SPRING 3 Framework and Postgress DB to allow ...
38
votes
9answers
12k views

Why is String immutable in Java?

I couldn't understand the reason of it. I always use String class like other developers, but when I modify the value of it, I need to create new instance of String. What might be the reason of ...
1
vote
1answer
250 views

Push-Based Events in a Services Oriented Architecture

I have come to a point, in building a services oriented architecture (on top of Thrift), that I need to expose events and allow listeners. My initial thought was, "create an EventService" to handle ...
-6
votes
1answer
47 views

What should I do [on hold]

Hi I am new to coding and going to study computer engineering but I don't know what language to go for or what software to use does anyone have an idea Can someone please help me
3
votes
3answers
3k views

Customer wants to modify the .properties files packaged in our WAR file

I have a customer who wants the ability to modify the .properties files packaged in the web applications WAR file so that they have the control to modify environments at settings. They will be ...
11
votes
4answers
569 views

Is it an overkill to wrap a collection in a simple class only for the sake of better readability?

I have the following map: Map<Double, List<SoundEvent>> soundEventCells = new HashMap<Double, List<SoundEvent>>(); This HashMap maps double values (which are points in time) ...
1
vote
2answers
137 views

When I create an object, is fresh memory allocated to both instance fields and methods or only to instance fields

I have a following class class Student{ int rollNumber; int marks; public void setResult(int rollNumber, int marks){ this.rollNumber=rollNumber; this.marks=marks; } public void ...
2
votes
2answers
357 views

How to translate SQL query into REST API requests?

Let's say I have a machine-readable description (such as in WADL, Swagger or RAML) of a REST API that provides interface to a database. My users submit queries about underlying database in form of ...
1
vote
1answer
86 views

Access Token Verification

I have spent quite a few days reading up on Oauth and token based security measures for REST API's and I am currently looking at implementing an Oauth based authentication approach almost exactly like ...
1
vote
1answer
50 views

Web-services REST security clarification

I'm newbie of web services programming and I have some problem to understand how to work authentication/security for REST WS pattern. I had read about OAuth but I haven't understand how it work in ...
1
vote
1answer
151 views

Java Desktop Application Requirement - Is sockets the preferred choice ?

I'm currently working on a requirement for a desktop application - using Java If for some reason the GUI crashes, it shouldn't affect the background process. Once the GUI is restarted - the ...
-2
votes
0answers
26 views

Steps for Oracle Certification [closed]

This is not a error question.I need some advice from yours in career path. Currently i am working as an Android Developer last 9 months.And now planing to move ahead in pure Java Development. I ...
43
votes
11answers
9k views

Why is it good to split a program into multiple classes? [on hold]

I'm still a student in high school (entering 10th grade), and I have yet to take an actual computer course in school. Everything I've done so far is through books. Those books have taught me concepts ...
0
votes
0answers
96 views

Do thin fluent builder method chains have any need to be “extensible”?

In an environment where refactoring is difficult extensibility can be a life saver. However, this is no excuse to over engineer code. Given that a thin fluent builder method chain is backed by well ...
-2
votes
1answer
87 views

JAX-RS and application wide business logic/resources. My brick wall has be found [on hold]

I think I'm definitely hitting a brick-wall in understanding how to implement this. I would very much appreciate any assistance in this. All my JAX-RS links, Oracle, IBM and Stack overflow links ...
-1
votes
1answer
76 views

Naming of methods that perform some actions under some condition [closed]

I often write such methods to avoid duplication in code and I give them name such as doSomethingIfSomeCondition(). For example: public class TaskDownloadFile { private boolean started; ...
2
votes
3answers
125 views

Proper interface for calculator library?

As practice, I'm planning to implement a multivariable calculator library. The idea is that you can define a function, such as f(x, y) = sin(x)^2 + 3*y^3, and then you can evaluate it with specific ...
0
votes
2answers
230 views

Organizing code in a 2 man team

I've been working with a buddy of mine on a school project. We forecast it'll take ~2 months, so it isn't a small scale project at all. Communication and splitting the work effectively has been a ...
-3
votes
0answers
8 views

incorrect output for set input [migrated]

So I almost have this code correct but it's not giving me the correct output for some reason and I can't figure out why. This is what I have. That is what I have so far but I need the output to be ...
11
votes
3answers
1k views

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

Disillusionment with the Portal Space I'm seeing a disturbing number of large, enterprise clients who have become disillusioned with their enterprise Portal experience, especially those in the ...
0
votes
0answers
41 views

Mixing newable and injectable in a Callable

I recently read http://misko.hevery.com/2008/09/30/to-new-or-not-to-new/ which discussed newable vs injectable objects. What would you do if you needed to make a Callable that talks to some service ...
0
votes
0answers
87 views

How far to go when future proofing fluent-method-chained-DSL test code?

Is it worth implementing interfaces, or using the getThis() trick, or even static factory methods to future proof against the need to extend this DSL? The current design is a pair of thin ...
3
votes
2answers
124 views

To subclass or to wrap for “default” implementation?

I'm creating a toolset in Java consisting of many Natural Language Processing (NLP) tools, such as Tokenizer, POS tagger, Lemmatizer, Sentence parsing, etc. I want to put all good and publicly ...
75
votes
16answers
24k views

When are Getters and Setters Justified

Getters and setters are often criticized as being not proper OO. On the other hand most OO code I've seen has extensive getters and setters. When are getters and setters justified? Do you try to ...
1
vote
1answer
129 views

How to migrate an XML serialization framework in Java in a tightly coupled system?

I work for a company that uses XML for storing a bunch of serialized Java classes. The framework we use is Apache Betwixt (abandonded in 2008) and it's kind of pain to maintain and extend (it seemed ...
1
vote
0answers
74 views

How to efficiently handle related data in MVC?

Talking about MVC with servlets and JSP's, in a context about products and manufacturers , when querying the application for a list of products: the servlet loads a list of products from the ...
7
votes
4answers
4k views

Command line options style - POSIX or what?

Somewhere I saw a rant against java/javac allegedly using a mix of Windows and Unix style like java -classpath ... -ea ... Something IMHO, it is no mix, it's just like find works as well, isn't it? ...
10
votes
6answers
26k views

Why does java.util.ArrayList allow to add null?

I wonder why java.util.ArrayList allows to add null. Is there any case where I would want to add null to an ArrayList? I am asking this question because in a project we had a bug where some code was ...
1
vote
1answer
149 views

Do you use static keyword to declare single instance pattern? [duplicate]

I just come across this code and find it interesting to know whether you consider this as another single instance pattern? public class Initiator { private static String str; // there is many ...