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.

259 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
7 votes
1 answer
425 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,522
5 votes
1 answer
573 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
0 answers
478 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 ...
ammut's user avatar
  • 159
5 votes
5 answers
2k 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
5 votes
1 answer
12k 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
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
401 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
323 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
220 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
3 answers
1k 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 ...
Danilo Silva's user avatar
3 votes
0 answers
71 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
708 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
351 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
156 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
463 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
727 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
384 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
  • 519
3 votes
0 answers
77 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
38 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
980 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
190 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
558 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
294 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
728 views

GetOrCreate method for a database operation

I have read this thread: Is it bad coding practice to create something in a get if it does not exist? But, my question involve a method which gets a record from a database or creates it if it doesn't ...
MrChudz's user avatar
  • 129
2 votes
2 answers
412 views

Exposing methods for polymorphic children from the aggregate root

Consider the following fictitious toy example: There is an aggregate root DayChecklist that holds a list of Tasks planned for the day: class DayChecklist { String id; DateTime today; ... ...
Cosmica's user avatar
  • 87
2 votes
0 answers
103 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
312 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
133 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
  • 29
2 votes
2 answers
160 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 ...
user3878073's user avatar
2 votes
0 answers
441 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
947 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
35 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
438 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
374 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
233 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
  • 581
2 votes
0 answers
400 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
397 views

Appropriate design / technologies to handle dynamic string formatting?

recently I was tasked with implementing a way of adding support for versioning of hardware packet specifications to one of our libraries. First a bit of information about the project. We have a ...
Mark W's user avatar
  • 129
2 votes
1 answer
554 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
89 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
84 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
2 3 4 5 6