Martin Ahrer

Thinking outside the box

Bean Mapping of Transfer Objects

2016-03-08 6 min read Martin

In the past years I have been working on multiple projects where the so-called Data Transfer Object (short DTO) pattern has been heavily used. This is a pattern that has even been a core pattern in the JEE world. This pattern certainly has its justification for the right cases. But in many cases I have seen it applied inappropriately. This blog posting by Adam Bien, a JEE advocate, is outlining the case where it should be considered useful. However when applied, this pattern comes at the cost of additional code to maintain and some extra CPU cycles for doing the mapping.

Continue reading

0001-01-01 1 min read
Build tool chain container images
export DOCKER_BUILDKIT=1
docker image build -t martinahrer/ansible:alpine -f Dockerfile_ansible .
docker image build -t martinahrer/footloose:alpine -f Dockerfile_footloose .
docker image build -t martinahrer/inspec:alpine -f Dockerfile_inspec .
Run all pipeline steps.
cd src/main/
drone exec --trusted drone.io/.drone.yml
Run the pipeline test step.
Continue reading

0001-01-01 1 min read
Start consul agent (in dev mode)
consul agent -dev -config-file server.hcl
open http://localhost:8500

0001-01-01 1 min read
Start nomad server and client agents
nomad agent -config server.hcl
nomad agent -config client1.hcl
nomad agent -config client2.hcl
nomad agent -config client3.hcl
open http://localhost:4646

The agents have no explicit consul configuration. So in case consul is running with default settings, nomad will connect using the defaults (https://www.nomadproject.io/docs/configuration/consul).

Continue reading

0001-01-01 1 min read

The following describes selected improvements of the Java JVM. See the Java 18 release notes.

With JEP-400, now UTF-8 is the default charset of the standard Java APIs.

In JDK 17 and earlier, the default charset is determined when the Java runtime starts. On macOS, it is UTF-8 except in the POSIX C locale. On other operating systems, it depends upon the user’s locale and the default encoding, e.g., on Windows, it is a codepage-based charset such as windows-1252 or windows-31j.

Continue reading

0001-01-01 1 min read

With a snippet region defined we can include a fragment of compileable and tested code.

Snippet Include
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/eighteen/tooling/JavaDocSnippetTag.java[tag=snippetInclude]

With a snippet tag we can just inline code. There is no need to escape or use HTML.

Continue reading
Older posts Newer posts