Skip to main content

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.

250 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10 votes
1 answer
539 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 ...
Zibbobz's user avatar
  • 1,572
6 votes
1 answer
14k views

Should I mock ObjectMapper in my unit tests?

I have different services in a spring application that have a dependency on Jackson ObjectMapper, the unit tests rely on @InjectMocks to inject all the various dependencies to the class that is under ...
Pampa Nello's user avatar
5 votes
1 answer
629 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 ...
w0wka91's user avatar
  • 59
5 votes
5 answers
3k 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 ...
Sriram Sridharan's user avatar
4 votes
0 answers
2k 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 ...
pdem's user avatar
  • 225
4 votes
0 answers
4k 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) ...
anonymous's user avatar
  • 141
4 votes
0 answers
1k 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 ...
John's user avatar
  • 41
4 votes
0 answers
207 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 ...
Dimag Kharab's user avatar
4 votes
0 answers
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 ...
ShaggyInjun's user avatar
4 votes
0 answers
402 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 (...
Jlaud's user avatar
  • 41
4 votes
1 answer
332 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)...
J Fabian Meier's user avatar
3 votes
0 answers
239 views

Logging by 3rd party libraries

We've got 2 very large platforms for our services & jobs. Both platforms consists of 20+ servers hosting 1000+ services/jobs. Each job/service is essentially a java web application. Both ...
Kelvin Wayne's user avatar
3 votes
0 answers
144 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. ...
sbke's user avatar
  • 39
3 votes
0 answers
81 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 ...
PaulEdison's user avatar
3 votes
0 answers
719 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 ...
Prashin Jeevaganth's user avatar
3 votes
0 answers
375 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 ...
Ken Po's user avatar
  • 31
3 votes
0 answers
159 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(...
neyrah's user avatar
  • 39
3 votes
0 answers
465 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 ...
user3198603's user avatar
  • 1,896
3 votes
0 answers
739 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 ...
nablex's user avatar
  • 655
3 votes
0 answers
79 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 ...
user39846's user avatar
  • 191
3 votes
0 answers
2k 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 ...
James111's user avatar
  • 173
3 votes
0 answers
102 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 ...
GameDroids's user avatar
3 votes
0 answers
39 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' ...
Joe Essey's user avatar
  • 191
3 votes
0 answers
998 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 ...
anonamousUsername's user avatar
3 votes
0 answers
197 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 ...
arisalexis's user avatar
3 votes
0 answers
598 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) ...
user avatar
3 votes
0 answers
2k 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 ...
user3804927's user avatar
3 votes
0 answers
562 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 ...
candied_orange's user avatar
3 votes
0 answers
456 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 ...
retrodev's user avatar
  • 387
3 votes
1 answer
302 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. ...
Harald's user avatar
  • 181
2 votes
2 answers
344 views

Should mocks used in unit tests represent entireties or subsets?

I was working on a unit test that has a mock object looking something like: public class TestMock { static { Doodad a = new Doodad(0); Doodad b = new Doodad(1); Doodad c = ...
pstatix's user avatar
  • 1,047
2 votes
0 answers
104 views

Why does the Java CompletableFuture API uses long + TimeUnit instead of Duration?

Java 9 introduced many new methods in the CompletableFuture API that support execution timeouts. For example: public CompletableFuture<T> orTimeout​(long timeout, TimeUnit unit); public ...
Mayank Dharwa's user avatar
2 votes
0 answers
338 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 ...
Tan's user avatar
  • 151
2 votes
0 answers
464 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 ...
parsecer's user avatar
  • 129
2 votes
2 answers
1k 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 ...
Markus K.'s user avatar
2 votes
0 answers
38 views

Periodically update files from s3 in a Java maven library used as Packaged JAR

I have an application say x which uses another Java library(say Y) as a JAR file . So y basically needs to download a file and load it into memory before any of it's methods are called at runtime by X....
techzombie's user avatar
2 votes
0 answers
464 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 ...
radlan's user avatar
  • 129
2 votes
0 answers
380 views

Camel processor interface on abstract class

I have an abstract class with one or two protected methods needed for the subclasses. abstract class TransformRouteProcessor { protected String doX(String arg1){ //doX code } ...
jbailie1991's user avatar
2 votes
0 answers
3k views

Scalable Ecommerce site system architecture?

If I need to design the system architecture for a scalable site like amazon/BestBuy, what can be high level system architecture. googled it but did not get much data points. Below is the high level ...
user3222249's user avatar
2 votes
0 answers
405 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 ...
EagleBeak's user avatar
  • 527
2 votes
0 answers
237 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 ...
redhead's user avatar
  • 591
2 votes
0 answers
136 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 ...
Mirrana's user avatar
  • 1,067
2 votes
0 answers
403 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)...
Kevin's user avatar
  • 1,341
2 votes
1 answer
564 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 (...
Clockwork-Muse's user avatar
1 vote
0 answers
81 views

Package-by-feature within maven multi module package-by-layer project

As a consultant working for multiple companies that are using maven multi modules I have made the same discovery with all of them that I find strange. Lets say they want to build a webapp for a ...
olimtrail's user avatar
1 vote
0 answers
91 views

Best Practices for multiple development efforts, different versions of Java

I'm the sole developer working on multiple projects on different versions of Java, plus some Microsoft Sharepoint front end projects. I REALLY need to figure out a better setup for my development ...
headlikearock's user avatar
1 vote
0 answers
90 views

Multitenancy - Multischema DB and should we handle by individual microservice basis?

I am looking into the revamping my organization's application by moving from a monolithic into a microservice-architecture. My database is a multi-schema shared in one database. Each of these schemas ...
Melvin Mah's user avatar
1 vote
0 answers
426 views

Simple Message Handler in Java with generics

I can easily put together a message handling set of generic apis in C# with the following quick and dirty code: void Main() { var messageClient = new MessageClient(new TestMessageHandler(), new ...
Andez's user avatar
  • 249
1 vote
0 answers
128 views

Correct usage of ETags?

Currently my code makes a series of updates to some resource via a REST API but I also have some "rollback" logic that basically updates the resource to its original state before my updates ...
Pepria's user avatar
  • 119
1 vote
0 answers
188 views

Rectangle packing / Bin packing with multiple frames

I have multiple rectangular frames, with different fixed heights. The width should be minimized and there is a maximum width. Then there are many different smaller rectangles. These should be packed ...
Wombosvideo's user avatar

1
2 3 4 5