sebastiandaschner news


wednesday, january 24, 2018

Welcome to the 20th newsletter.

Do you know what I think is one of the best tips for software developers to improve their skills (and career opportunities, and salary negotiation position)?

Reading books.

I know this may sound boring for some, but reading does make as difference (not only in IT, btw.). In the last newsletter, I’ve shared my personal IT book favorites. I encourage you do the same; maybe using the #readingmakesadifference Twitter hashtag.

The book I’m currently reading is the third edition of Effective Java by J. Bloch. It contains a lot of recommendations and some do’s and don’t that most experienced developers would discount as “obvious”, “common sense”, or “gut feeling”. However, the reasoning and motivation behind these advices contain knowledge that was new at least to me in so many examples; I’ve already learned a lot reading it.

Slowly, this year’s Java travel season is starting. Next week, I’m giving new client workshops about Docker, Kubernetes and OpenShift for Enterprise Java applications. In February, the first conferences start again; already looking forward to see some familiar faces :-)

 

What’s new

 

Strategy pattern with CDI and lambdas

The strategy design pattern dynamically chooses an implementation algorithm, a strategy, at runtime. The pattern can be used to select different business algorithms depending on the circumstances.

We could define different algorithm implementations as separate classes. Or we make use of Java SE 8 lambdas and functions, that serve as lightweight strategy implementation here.

CDI is capable of injecting parameterized types:

public class Greeter {

    @Inject
    Function<String, String> greetingStrategy;

    public String greet(String name) {
        return greetingStrategy.apply(name);
    }
}

A CDI producer creates and exposes the greeting depending on the dynamic logic. The actual strategy is represented by the Function type and being selected dynamically:

public class GreetingStrategyExposer {

    private final Function<String, String> formalGreeting = name -> "Dear " + name;
    private final Function<String, String> informalGreeting = name -> "Hey " + name;

    @Produces
    public Function<String, String> exposeStrategy() {
        // select a strategy
        ...
        return strategy;
    }
}

 

Continuous Delivery video course

Besides reading books, video courses are also a good option to improve your skills :-)

In the last newsletter issue, I’ve announced a new video course about the topic of moving Enterprise Java projects to Continuous Delivery. Setting appropriate pricing is not always easy — especially when there aren’t much comparable offerings out there.

The course is targeted for enterprise projects that are in need to use properly-implemented Continuous Delivery pipelines. From my experience as a consultant this is an important topic and sadly neglected too often.

However, in order to make the course more affordable, especially for individual Enterprise developers, we changed and restructured the pricing options. The course is now at EUR 200, with a 20% discount if you’re fast and enroll it until the end of February. If you feel like this amount is too much at once, you now also have the option to pay EUR 20 for 12 months — without a discount.

Have a look at the course contents here.

 

Thanks a lot for reading and see you next time!

 

Did you like the content? You can subscribe to the newsletter for free:

All opinions are my own and do not reflect those of my employer or colleagues.