Handle custom exception types in JAX-RS

java-interview-questions-answers

JAX-RS supports handling custom exceptions — thrown in either EJBs or CID beans — to custom HTTP responses. Assuming we have an “exceptional” EJB: @Stateless public class Hello { public String greeting() { if (new Random().nextBoolean()) throw new GreetingException("Could not greet"); return "hello"; } } @ApplicationException public class GreetingException extends RuntimeException { public GreetingException(String message) { super(message); } } The EJB is used in ...

Read More »

Microservices with Akka

As mobile and data-driven applications increasingly dominate, users are demanding real-time access to everything everywhere. System resilience and responsiveness are no longer “nice to have”; they’re essential business requirements. Businesses increasingly need to trade up from static, centralized architectures in favor of flexible, distributed, and elastic systems. But where to start and which architecture approach to is still a little ...

Read More »

Gettin’ schwifty with Clojure’s core.async

A few months ago, somebody in the office pointed us to an interesting  job offer from CartoDB which looked as follows: What follows is a technical test for this job offer at CARTO: https://boards.greenhouse.io/cartodb/jobs/705852#.WSvORxOGPUI Build the following and make it run as fast as you possibly can using Python 3 (vanilla). The faster it runs, the more you will impress us! ...

Read More »

Learning to use Wholly GraalVM!

Introduction In the post Truffle served in a Holy Graal: Graal and Truffle for polyglot language interpretation on the JVM, we got a brief introduction and a bit of deep dive into Graal, Truffle and some of the concepts around it. But no technology is fun without diving deep into its practicality, otherwise its like Theoretical Physics or Pure Maths ...

Read More »

Invest in a Github Organization!

To start, let me say that Github is the subject here simply because they are the biggest in the open source industry. Github has become the Facebook of software development and that is why it makes sense to focus on it. In the future, a better platform might show up and then this article will apply to that one. A ...

Read More »

Recursion

Recursion is a technique that allows us to break down a problem into smaller pieces. This technique allows us to remove some local side effects that we perform while writing looping structures and also makes our code more expressive and readable. In this post we will see why it is a very useful technique in functional programming and how it can help ...

Read More »

Introducing Interaction-Driven Design

Before reading this post, I strongly recommend you read the two previous blog posts that serve as a foundation to this blog: MVC, Delivery Mechanism and Domain Model and A Case for Outside-In Development. Most software projects become very difficult to maintain and evolve after a period of time. Business is constantly complaining that things take forever to be delivered. Developers complain the ...

Read More »

On Tail Call Optimisation

If you are interested in functional programming as many of our craftspeople are, you will have heard talk about tail recursion. Tail recursion refers to a recursive function call that has been made from tail position. When a function call is in tail position it means there are no more instructions between the return of control from the called function and ...

Read More »

When does a Start-Up need Agile?

I started writing another piece on more economic and agile/software development but it got to long, so right now, an aside… Back in 1968 Peter Drucker wrote: “Large organizations cannot be versatile. A large organization is effective through its mass rather than through its agility.” Last week I presented “Agile for Start-ups” here in London for the third time. Each time I’ve given this ...

Read More »