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

5
votes
0answers
297 views

How can I make a universal construction more efficient?

A "universal construction" is a wrapper class for a sequential object that enables it to be linearized (a strong consistency condition for concurrent objects). For instance, here's an adapted ...
4
votes
0answers
94 views

Is the observer pattern suitable when the observers are not independent of each other?

I have a class Car which has 2 properties: int price and boolean inStock. It also holds a List of abstract class State (empty class). There are 2 states which can be applied on the car and each is ...
4
votes
0answers
634 views

Fluent interface implementation and reflection. Case study

I hope I picked the right group for this question... I have this little framework I want to implement and I would like to have an opinion on it. In particular I am more concerned about the ...
4
votes
0answers
520 views

Design thoughts on a schema based request object for CXF endpoint

Trying to seek design suggestion on a schema based request object for a CXF endpoint. I've created a CXF SOAP endpoint which takes the following object as an input. The request object will have ...
3
votes
0answers
85 views

Finger Paint path gets huge over time and slows the app

So I am writing a Finger paint app. I have multiple color which user can select. I save the path and paint information inside an array. ArrayList<PaintPath> arrayPaintPath = new ...
3
votes
0answers
73 views

Determine equality of a DAG

Given a fairly traditional node class (below), whats the best way to implement equality on a given graph? If our node looks like this public abstract class Node{ private final Set<Node> ...
3
votes
0answers
146 views

How to distribute a number of elements in a bucket so that it is within a range?

I have 50 elements n1, n2, n3, ... , n50 and a limited number of buckets, say 5 buckets and each bucket can hold a range from, say 100 to 150 only (which is nothing but the sum of the elements in that ...
2
votes
0answers
60 views

How do I design concurrent scalable system with guaranteed ordering? How about Akka?

I have designed a simple PoC system that processes a feed of prices that tick. It consumes a stream of "Ticker, Price" objects off JMS and updates a map, so that the map simply contains the latest ...
2
votes
0answers
73 views

Error handling in distributed system

This is the common sequence of two distributed components in our Java application: 1 A sends request to B 2 B starts some job J in parallel thread 3 B returns response to A 4 A accepts ...
2
votes
0answers
25 views

Approach for querying an arbitrary set of user submitted fields and values in Spring application? Like a shopping site sidebar search?

I am working on a Spring Boot and Angular application which has a requirement to search based on any number of the available filters being applied to a list. For example, a user searches on 'Title' ...
2
votes
0answers
127 views

Creating a better mouse dragger function

I originally posted this to code review, not knowing incomplete code was off-topic and was pointed to post here. I don't believe this question is a good fit for stack overflow because the code I ...
2
votes
0answers
174 views

What is a “shaded” JVM client?

JVM developer here. Lately I've seen banter on IRC chat rooms and even in my own office about so-called "shaded" Java libs/clients. The context of the use will be something like: "Such and so ...
2
votes
0answers
425 views

Architecture design for Java servlet that triggers work (for sending push notifications)

I'm designing a push notification server (for pushing notification via APNS and Google servers) and have come up with the following design for a Java based web application server. I would really like ...
2
votes
0answers
532 views

Cross-compiling Java app to run directly on ARM

Please note: although I am using ARM SAM3X8E in this example, I'm just using that as a concrete example, and the answer to this question could easily be given using any other MCU such as AVR, etc. I ...
2
votes
0answers
109 views

Embedded tomcat cold deployment without service disruption

I have the following scenario. For various reasons I chose to use embedded tomcat for my rest backend that will form a cluster of AWS machines. I will want to deploy fairly frequently updates ...
2
votes
0answers
242 views

vert.x message bus architecture

A large part of the vert.x architecture is around the message bus, and message passing between verticals. The main idea I guess being that I can create multiple modules (possibly in multiple ...
2
votes
0answers
159 views

Incorporating custom Algorithm in SOLR-LUCENE , before Indexing?

CURRENT FLOW: I am using a custom algorithm(presently in php) to rank the MYSQL records before INDEXING it to SOLR . WHAT I WANT : Is it possible implementing this ALGORITHM(may be in JAVA) inside ...
2
votes
0answers
335 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
0answers
305 views

Benefits of EJBs over POJOs for Jersey JAX-RS Resources

I'm writing a Jersey 1.9 JAX-RS application. I have to use 1.9 because it's the only supported version. I'm trying to decide if there is any benefit to using EJBs as my Jersey Resources, rather than ...
1
vote
0answers
71 views

Find fastest connection to a certain point

What i'm trying to implement is a program that is searching for the fastest connection from one station to other at a given time of the day. I have a number of stations n, and a number m of lines ...
1
vote
0answers
18 views

How do I properly manage EntityManagerFactory and EntityManagers for long running tasks?

We're building a JavaFX application that connects to a remote Oracle database using EclipseLink on one end and a SOAP service on the other end. We're writing long running transactions that will pull ...
1
vote
0answers
36 views

Why Does JavaFX's GridPane Attach Properties of the Layout to the Components?

I am currently learning JavaFX and I came across a very strange API for laying out GUI components. It is perhaps best explained by it's javadoc: To use the GridPane, an application needs to set ...
1
vote
0answers
38 views

Polymorphically handle result of subtraction

I have an amount class which provides the minus method among others. The result of this operation is of course another amount. The question is how can I handle the three cases according to the signum ...
1
vote
0answers
61 views

Downloading information, but just when needed

I'm struggling with thinking of how to implement the following (in java): I try to create a program, that displays information about lots of tv series. For this i use the website "Burning Series" ...
1
vote
0answers
55 views

How to report multiple errors as a result of validation?

I have a class that transforms a complex model, for example an abstract syntax tree or intermediate model. The model can be either valid, invalid or partially invalid, i.e. it contains errors but some ...
1
vote
0answers
55 views

Creating duplicate instances of objects for timeline functionality

I am working on a Spring-MVC based project, in which I would like to add Timeline functionality. The most important object in our project is the Note, there are objects associated with it like ...
1
vote
0answers
61 views

is Command appropriate software pattern for this?

I have following task: I need to send several instructions after each other to the hardware. Next instruction is never sent before either answer to previous instruction comes (valid answer or error) ...
1
vote
0answers
103 views

Change object state in different point in program

This is not about whether or not getters/setters are wrong. I understand its impact to encapsulation and that question has been raised here and SO several times already. I also do not want to just ...
1
vote
0answers
117 views

Handling multiple rest api versions within Android Java client

Actual architecture I have an app where a model is attached to every activity. The model ask a repository for information that can come from server or local db depending on many factors. When it asks ...
1
vote
0answers
28 views

Correlating Search Classifiers in a Database Scan for Sensitive Information

Problem Description I am working on an enterprise data discovery project that is designed to scan databases for sensitive information. The basic search unit is called a classifier and covers things ...
1
vote
0answers
54 views

Why is conditionally using an empty panel in Apache Wicket a bad practice?

When Apache released its list of best practices, they recommended avoiding the addition of an empty panel conditionally and gave the following example of what NOT to do: ...
1
vote
0answers
109 views

CQRS “private” command

In CQRS, if a saga (or more precisely a process manager according to the CQRS Journey book) sends out a new command to change aggregates how can I ensure that this command is not possible to send from ...
1
vote
0answers
96 views

Better choice of Queue then a ConcurrentLinkedQueue if I have low number of threads in Java

I have two threads, one that is reading messages from the web and putting them into some sort of a queue. The other is suppose to read it. I looked into a ConcurrentLinkedQueue and it looks good for ...
1
vote
0answers
134 views

Approaches to Modeling a Graph Database over the Google App Engine Datastore?

I want to model a graph database over the Google App Engine Datastore. I am currently working on creating a Link entity to model the concepts of link/edge/relationship to the graph of objects. I am ...
1
vote
0answers
170 views

Threading strategies for a webservice implementation

If I am building a webservice/Web API for servicing requests, there are 2 threading strategies I can think of. I will explain this in terms of Java (though the question may be relevant for any other ...
1
vote
0answers
77 views

How to design an interface for two similar but distinct objects

I'm designing an API for a JavaFX control to be submitted to the ControlsFX library. This control is called the ViewManager, and its purpose is to hold a collection of View instances, all of which ...
1
vote
0answers
124 views

Approach for polyglot logging

I'm building a desktop app with a Java front-end and very performance critical Fortran libraries. We've recently started pushing more of our code out of Java and into Fortran (see below) Soon we will ...
1
vote
0answers
55 views

JavaBeans vs. ActiveX: Strategic analysis

JavaBeans and ActiveX both serve the same basic function: to facilitate communication among software components within framework "containers." These containers include Web browsers and other document ...
1
vote
0answers
108 views

Efficient extensions of degree of separation

I'm trying to play around with the 6 degrees of separation problem, specifically the Kevin Bacon game to find alternative ways of playing the game. I want to eventually port it over to MapReduce, but ...
1
vote
0answers
202 views

MVC question for a console application with multiple controllers?

My question concerns an administrator's console application. The requirements around it are that administrators should be able to log in (other types of user cannot), and they should then be able to ...
1
vote
0answers
188 views

Will using a pure MQTT approach be the right decision?

I plan to provide additional functions for a closed-source 3rd party point of sales application. That application is used in restaurants, is run on Windows and uses dbase style databases. I know the ...
1
vote
0answers
406 views

How to loop through array bidimensional in diagonal according to a position in degrees

The title could be no self-explanatory enough but I need some conceptual help in order to implement a solution to go through an array: I'm developing a program to calculate the "most shadepath" route ...
1
vote
0answers
54 views

Can't figure out how to parallelize the calculation of the amount of offspring expected for species in genetic algorithm

I developed a genetic algorithm in java 8 taking advantage of its reasonably free parallelism opportunities with Streams. As you are likely aware, running the epochs takes its time for even a test ...
1
vote
0answers
90 views

handling external events in a cluster environment

I have an app written with JSF and Spring using JPA+Hibernate which is running on a Glassfish4 server. Right now I have an Observer pattern which is listening for some Postgresql events. Let`s say ...
1
vote
0answers
113 views

How is ORB distinct from an endpoint?

What, fundamentally, am I misunderstanding about how to use appclient? The Application Client Container (ACC) includes a set of Java classes, libraries, and other files that are required for ...
1
vote
0answers
106 views

Enforce coding decision to include or exclude an Enum element in an EnumSet at compile time

I would like to enforce that the elements of a Java Enum are chosen or excluded from an EnumSet at compile time i.e. I am forced to make the decision to put it in the set or not whenever I create a ...
1
vote
0answers
206 views

Optimal data structure for binary data/Java

I have several input formats mostly restricted to geotiff and some proprietary binary formats. I import them into my program and then need to export them into various other data formats (also binary) ...
1
vote
0answers
161 views

How and where to make global function file in jsp sevlet web application

I am making a website in Servlet&JSP. I am looking for good way to make a specific function file from where I can call and declare my common functions. If I made a java file function. Java, so is ...
1
vote
0answers
93 views

Multiple 1024x1024 texture pages or one 2048x2048 texture page?

I have a lot of textures around the size of 512x512, and the LibGDX texture packer can't find a way to put more than one of those on one page for some reason. So, I end up with fifteen or sixteen ...
1
vote
0answers
57 views

Individual methods or parameters for Google Analytics abstraction on Android

A coworker and I are having a discussion around the best way to build our abstraction on top of Google Analytics for an Android application. A couple of data points. We have auto-tracking enabled ...