Questions tagged [java]

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.

230 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7
votes
0answers
662 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 ...
6
votes
0answers
850 views

Should I annotate all the entry points in my library?

In a library project, I see numerous warnings suggesting that I reduce the visibility of public classes and methods. (Or in the case of methods I haven't written tests for, warnings about them being ...
6
votes
0answers
194 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 ArrayList<...
4
votes
0answers
369 views

FRP-style GUIs in Java

I recently built a small web application using riotjs, a library that facilitates creating UIs in the spirit of functional reactive programming, i.e. defining the UI as a pure function of the ...
4
votes
0answers
227 views

Should I be concerned with dependencies?

Our organization uses IBM ClearCase to manage its versioning controls (for better or worse). We've been working on our application for several years now, and a large number of activities have started ...
4
votes
0answers
867 views

Allowing users to add their own custom fields in a Spring MVC Hibernate application - What's an ideal approach?

We all may have seen applications like JIRA, or many CRM or other applications that allow its users to define their own custom fields to an entity, and do a variety of stuff with it, like making them ...
4
votes
0answers
2k views

Java 8 time - LocalDateTime vs LocalDate and truncatedTo limitation handling

I am new to the Java 8 time package, and am trying to better understand it and make sure that I am making good use of it. Is there a specific reason that LocalDateTime's truncatedTo(TemporalUnit) ...
4
votes
0answers
202 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 ...
4
votes
0answers
389 views

How to deal with runtime changes to tenant-location in a clustered, multitenant web application with app-managed datasources?

I have a Java web application that supports multi-tenancy to keep customer data separate. Connection pools to each customer database are created at runtime. The details of each customer shard (...
4
votes
1answer
215 views

Staging of artifacts in the build server?

Java artifacts are often staged through different "quality levels", named like alpha, beta, releaseCandidate, release etc. They enter the next stage if they have passed tests (automatic or manual ones)...
4
votes
1answer
502 views

Persistent Model to Domain Model mapping without exposing domain object's attributes

I know this is a common question, but I haven't found another that solves my doubts. Usually, if the project is small, I've persistence annotations in the same object that represents the domain ...
3
votes
1answer
198 views

Is Enum Polymorphism bad for DAO Methods?

I have been going back and forth in a discussion about polymorphic enums to call different DAO methods depending on enum entry, and I haven't been able to get a common agreement on this subject. Lets ...
3
votes
1answer
92 views

Externalized properties for an Java EJB application

I am not sure if this is the right place to post this question, but I think this might be better suited than Stack Overflow. I have got an online application, a Java EJB application. Requirement is ...
3
votes
1answer
173 views

Applying Domain Driven Design - Model/Implementation

I'm quite new in the DDD-World and I'm just trying to figure out all the basics so please bear with me! I have the following Entities: - Datamodel - Object Types - Object Fields A datamodel can ...
3
votes
2answers
191 views

Passing a list of base class objects to a method and using instanceof to filter them

I'm working on a Java reverse engineering project, where I am analyzing bytecode and trying to identify classes, methods and fields using the ASM framework. After identifying these I transform some ...
3
votes
0answers
55 views

java hashtable extending to support duplicates

I have to maintain an old application and have to extend some modules. There is an hashtable that is used for maintaining/holding some objects as representation of running (real) processes (don't see ...
3
votes
0answers
215 views

Is this an example of cyclic dependency?

I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic overview. I have wrote my ...
3
votes
0answers
42 views

What are some design ideas for a data mapping and transformation application?

Here is a high level outline of the project: We frequently need to convert data from a new incoming system to our in house system (sort of a basic ETL process) We would prefer to do this dynamically, ...
3
votes
0answers
164 views

Chronicle Queue: how to make a stack and how to limit disk usage

My server and several clients are different JVMs running on the same machine, they need to share persisted time series data: server reads a time series from somewhere, writes to a persisted embedded ...
3
votes
0answers
103 views

Ripple Effect Analysis using coupling metrics

How can I observe ripple effect using coupling attributes alone? I first find the common coupling metrics for a set of deprecated classes in a project, like CBO(Coupling Between Objects), RFC(...
3
votes
0answers
840 views

How to avoid DTO on a client/server application?

I would like to use DRY beans on my client-server application (DRY: Dont Repeat Yourself). It is not a problem to me if it is highly coupled: I know that my DTO will have the same form as the ...
3
votes
1answer
202 views

Inheritance vs Injection with Template-ish pattern and planned contributors

I'm trying to develop an OSGi application to handle my game engine. This game engine will be making use of the Entity-Component-System pattern. Part of this pattern is the use of GameSystems. I had ...
3
votes
0answers
268 views

Designing clickstream analysis?

I have a application where user purchases/click the certain products. I need to design the click stream analysis here which product got clicked how many number of time, user/geographical detail click ...
3
votes
0answers
609 views

Long lived connections

I have a custom non-blocking I/O server that supports (among other things) HTTP and websockets. I have two timeout concepts for connections: idle: connections that don't do anything are closed after ...
3
votes
0answers
341 views

Examples for “serverless” Java service for AWS Lambda

Doesn anybody have practical experience with implementing a (micro)service based on AWS Lambda? My team is currently working on an MVP. We started with a monolith and that has worked very well. It's ...
3
votes
0answers
71 views

Pattern for retrieving batches of Objects?

This seems to be a recurring requirement for me, so I'd like to get some feedback on how to implement it and what sort of test code makes sense. I need to retrieve batches of data and stitch it ...
3
votes
0answers
950 views

How should I store user activities in ElasticSearch and figure out popular searches?

I've got java logging user activities to Fluentd, Fluentd is then writing these activities into an elasticsearch index. Every user activity is recorded, some include: User1 follows user2 User1 likes ...
3
votes
0answers
99 views

Are Remote EJBs the right way to go?

I am planning to remodel my current application and I am not sure if this is the right approach. Currently I have a Java Enterprise server application with 3 web-applications and an ejb-application ...
3
votes
0answers
35 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' ...
3
votes
0answers
684 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 ...
3
votes
0answers
994 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 ...
3
votes
0answers
183 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 ...
3
votes
0answers
556 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) ...
3
votes
0answers
1k views

How to pass control between sub-controller to parent controller in Java MVC Design Pattern?

I'm pretty new in Java, but I've done plenty of research and I know what MVC is. However, to implement MVC in Java was a difficult task. I followed this tutorial, which helped me to realise that the ...
3
votes
0answers
518 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 ...
3
votes
0answers
2k views

Spring bean injection into a hibernate validator constraint

I have a controller method like listed below whose argument is annotated with @Valid to validate PasswordChange object using a Hibernate validator @Constraint. Both PasswordChange and a sample ...
3
votes
0answers
453 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 ...
3
votes
1answer
458 views

Dependent Object Serialization

What's the recommended way to serialize dependent objects, especially when objects are being freshly constructed (to avoid malicious byte streams, or whatever)? For example.... After creating a (...
3
votes
1answer
216 views

Language support for (syntactic) delegation in Java

Composition over inheritance is an old trend or even accepted state of the art in object oriented programming. It would be even easier to use in Java, if there were language support for delegation. ...
2
votes
0answers
36 views

Send push notifications from ActiveMQ

I am trying to figure out how to send push notifications back to the client in the following ActiveMQ scenario: I have a spring boot web application #1 deployed on tomcat on RHEL server. From the ...
2
votes
2answers
209 views

Domain models vs entity models vs Hibernate lazy loading

In a new Java project I plan to use an extra layer above Hibernate entities. So there would be a CustomerEntity and CustomerDomain. The reason for that is that the CustomerDomain can contain extra ...
2
votes
2answers
180 views

destroy object once it won't be used anymore in flyweight pattern

I want to use flyweight pattern to return the same instance of my object each time. public class ThingFactory { private static final HashMap<UUID, Thing> things = new HashMap<>(); ...
2
votes
0answers
64 views

Design Pattern to unify similar generated classes

I have a project where I work with generated classes for some web interfaces. Some of these classes are (almost) identical and most of the functionality I need them for only use the identical parts. ...
2
votes
0answers
43 views

How to manage cart details across various devices

Recently I was asked in a interview to implement to e-commerce site . One of the requirement was to maintain cart details across various devices .(i.e) if user adds a book from his iPhone , and when ...
2
votes
0answers
72 views

Third-party API wrapper in Java: how to design

Suppose, there's a site that provides an API, such as this: Users post questions, answers on that site You can make GET and POST calls There are two types of authentication: weak (only gives read ...
2
votes
0answers
179 views

How to handle a large number of optional parameters

I am currently developing on a small library allowing to read and write Java .properties files while retaining all the formatting (comments, whitespace, etc.): https://github.com/hupfdule/apron This ...
2
votes
0answers
205 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 ...
2
votes
0answers
388 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 languages)...
1
vote
1answer
32 views

RMI vs APIs vs Akka Cluster

We have a Java Play Framework Application which we want to scale out into a cluster. The only issue is that there are services ran by the Akka Scheduler once per day, and we don't want these services ...
1
vote
0answers
60 views

How to solve circular dependency scenario while executing http calls which require authentication?

I am working on a project which requires me to execute standard HTTP calls with session tokens. I am building a custom HTTP client, with a custom authenticator, something like this: Client client = ...