Monday, June 13, 2016

Active Conference Presentation Abstracts

Speaking at conferences has become a regular activity for me. To save time for both me and conference organizers, I maintain this list of presentations I'm actively submitting to conferences and user groups. My presentations are updated frequently to reflect current industry changes and events. If you're a conference organizer, I'm always willing to discuss enhancements that will allow one of my presentations to more closely fit your upcoming event.  As always, I'm interested in suggestions for new presentation topics.  

If you're interested in more detailed information about any of these presentations, I always post presentations on my Slideshare. Keep in mind that slide decks are frequently updated, so a deck you see on a future presentation may be different than what's currently posted.


Upcoming Presentations

Note: Presentations currently in development; no slide decks yet available.


Managing AWS using Terraform: Implementing Infrastructure as Code

(60 minutes)

Microservices Presentations


Managing Microservices using Terraform, Docker, and the Cloud

(60 to 120 minutes)
Note:  This presentation has an optional hands-on session.

Much has been written about how to write Microservices, but not enough about how to effectively deploy and manage them. Microservices architecture multiplies the number of deployables IT has to manage by at least 10x. In that world, tooling to manage cloud deployments and related infrastructure becames essential for success. Terraform and Docker are increasingly being leveraged to facilitate microservice environments. Terraform has become becoming the leading coding framework for building and managing change in cloud environments. 

Attendees will learn best practices for deploying and managing microservices in production. We will leverage true "infrastructure as code" using Terraform. That code is easily re-used and make changes easy. That code makes it easy to deploy and scale software including Docker images. You will learn not only how to establish that environment initially, but how changes can be effectively managed. I'll cover best practices and common mistakes along the way. AWS will be used as the cloud provider, but Terraform operates seemlessly on other cloud environments as well.


This session is targeted at architects and team leads. This session is intended to be platform-generic.
 This session has an optional hands on portion.  Detailed instructions are here. Requirements are:
  • Terraform installation (https://www.terraform.io/downloads.html)
  • Text editor of choice
  • AWS Web Service account (resources used will be free tier to keep costs to a minimum)
  • Internet connectivity

Refactoring into Microservices: Breaking The Monolith

(60 to 75 minutes)
Microservices architecture has become a widely popular topic. Most of us are aware of what microservices are and the problems they are meant to solve. Most microservice implementations were originally monolithic applications that grew too large and complex to support. However, refactoring into microservices is much easier said than done.   
This presentation will provide you guidance for refactoring a monolithic application into microservices. I'll provide an overview of the entire process along with best practices and common mistakes along the way. This presentation is meant to be platform-generic; you can use these concepts on applications written in any programming language. This presentation is targeted for senior developers and tech leads. 

Microservices for Architects

(60 to 75 minutes)

Given published success stories from Netflix and Amazon, many companies are adopting microservice architecture. This session will provide you with an understanding what microservices are and what benefits they provide. You should also be made aware of pitfalls and best practices for adopting this approach. I will provide guidance on effective microservice contract design and survey the most important design patterns. I will survey cross-cutting support concerns that all microservices share and point out common mistakes along the way. 

This session is targeted at architects and team leads. This session is intended to be platform-generic.

Microservices for Java Architects 

(60 to 90 minutes)

Given published success stories from Netflix and Amazon, many companies are adopting micro service architectures. This session will provide you with an understanding what micro service architectures are and what benefits they provide. You should also be made aware of pitfalls and best practices for adopting this approach. This session is targeted at Java developers and architects; coding examples will be Java. This session will also provide an overview of tooling that supports micro service architectures such as Docker, Spring Boot, Dropwizard, and a few more.

Writing Microservices in Java: Best Practices and Common Mistakes 

(60 to 90 minutes)

Given published success stories from Netflix and Amazon, many companies are adopting microservice architectures. For organizations that are heavily invested in Java technologies, writing microservices using Java is a natural progression. This session concentrates on best practices for coding microservices using the JVM. An overview of useful coding and deployment patterns will be included that make microservices more resilient and supportable. Tooling useful with implementing these patterns will be highlighted. Along the way, I'll also note common mistakes.
This session is targeted at Java developers and architects; all examples will be Java. I will provide a short definition section about what microservices are to level set.

Cloud Technology Presentations

AWS Lambda Deployments:  Best Practices and Common Mistakes

(50 minutes)
"Serverless" architectures, such as AWS Lambda, Google Cloud Functions, or Azures Serverless Compute service, relieve you of hardware and scaling set-up concerns. Large companies such as Netflix, Cmp.LY, VidRoll, and other organizations are introducing serverless technologies into their technical stacks. This presentation concentrates on the AWS Lambda product as it was the first cloud-based serverless architecture and is leading the trend. However, comparison and contrast with the Google and Azure offerings will also be included. 
This presentation will provide you with an overview for AWS Lambda and the products advantages and disadvantages. I'll include an overview on how to create and deploy Lambdas providing examples along the way. I'll also include a discussion of best practices and when use of Lambda is appropriate.  This presentation is targeted for senior developers and architects.

AWS Lambda for Architects

(60 to 75 minutes)

Lambda is a "serverless" architecture that relieves you of hardware and scaling set-up concerns. Amazon AWS introduced Lambda at AWS Re-Invent 2014. Adoption of Lambda has grown exponentially ever since. Netflix, Cmp.LY, VidRoll, and other organizations are introducing Lambda into their technical stacks. In addition, Amazon competitors are working aggressively to introduce competitors to AWS Lambda. Lambda has many uses within applications as well as in a Dev Ops world. 
This presentation will provide you with an overview for AWS Lambda and the products advantages and disadvantages. I'll include an overview on how to create and deploy Lambdas providing  examples along the way.  I'll also include a discussion of best practices and when use of Lambda is appropriate.  This presentation is targeted for senior developers and architects.

AWS Lambda for Java Architects

(60 to 75 minutes)

Lambda is a "serverless" architecture that relieves you of hardware and scaling set-up concerns. Amazon AWS introduced Lambda at AWS Re-Invent 2014. Adoption of Lambda has grown exponentially ever since. Netflix, Cmp.LY, VidRoll, and other organizations are introducing Lambda into their technical stacks. In addition, Amazon competitors are working aggressively to introduce competitors to AWS Lambda. Lambda has many uses within applications as well as in a Dev Ops world. 
This presentation will provide you with an overview for AWS Lambda and the products advantages and disadvantages. I'll include an overview on how to create and deploy Lambdas providing Java examples along the way. I'll also include a discussion of best practices and when use of Lambda is appropriate. This presentation is targeted for senior Java developers and architects. Please note that AWS Lambda is not to be confused with Java 8 Lambda expressions; they are different subjects entirely.


Sunday, June 5, 2016

Making Unit Testing Private Methods Easier

Earlier this year I blogged about testing private methods (here). I noted that FieldUtils utility from Apache Commons Lang product has one-line utilities to access private fields. While explaining to readers that Lang's MethodUtils utility should have a one-line utility to access private methods so that we can more easily test them directly. I explained that this is preferable to over-exposing those methods (e.g. making them protected) merely so they can be tested. 

As a result I filed LANG-1195 and contributed an enhancement for MethodUtils so that it can easily invoke private methods for testing. I'm happy to announce that my enhancement has been accepted and committed (Pull 141). Expect to see it in Commons Lang 3.5 when it's released.

Method Additions
Like FieldUtils, boolean forceAccess is true, private methods can be seen and executed through reflection. There is no need to set forceAccess to true for methods already visible (e.g. protected or public).  

These methods allow you to directly test private methods in unit tests. There's no longer a need for the common practice of making methods protected for the sole purpose of accessing them in unit test code. 

These methods really should only be used in unit test code. From an architectural perspective, production code should not be used to invoke methods that were never designed to be executed outside the context of that class. Some argue that private methods should not be tested directly as they are not exposed. As those of us with clients that have mandated 100% line, branch, and mutation coverage; we know that that's nearly impossible being restricted to testing private methods only through public or protected methods that use them.

Another argument against testing private methods is that it created a coupling between classes (the test class and the tested class) that was never meant to be. My response is that yes, it does create coupling. However, unit tests are very tightly coupled to their targets anyway. Secondly, it means that some code in private methods goes untested as testing them indirectly is too tedious and difficult.

These methods do not benefit from compile time checks. One of the reasons I don't advocate using these methods in production code is that they can't be checked by the compiler. Direct method execution can be checked as to syntax, accessibility, and correct parameter type usage. These methods bypass those two checks.

Specifically, methods added follow. If you use these, please let me know if you see issues or problems.

Invoke Private Method without Arguments
This is also patterned after the existing method invocation without the forceAccess option.

Method signature
invokeMethod(Object object, boolean forceAccess, String methodName)

This is used to invoke a private method in a class. Yes, the accessibility attribute on the method is temporarily set to true so that the invocation works, but it's set back to it's original after execution. A usage example is below.

Example 1
String result = (String)MethodUtils.invokeMethod(testBean, true, "myPrivateMethod");

Invoke Private Method with Arguments
This is also patterned after the existing method invocation without the forceAccess option.

Method signature
invokeMethod(Object object, boolean forceAccess, String methodName,Object... args);

Example 2

String result = (String)MethodUtils.invokeMethod(
    testBean, true, "privateStringStuff", "Hi There", 5, new Date());