Derek C. Ashmore's Blog, page 5
January 2, 2016
Testing Private Fields and Methods in Unit Tests
Covering private code in unit tests can be problematic as they aren't directly executable from unit tests. I've seen developers take one of two approaches. One approach is to embed tests for private code in unit tests for protected or public methods. Another is to escalate the declaration in the code being tested from private to protected, so that they can be more easily handled in unit tests. Both approaches are problematic.
Testing private methods indirectly through p...
Testing private methods indirectly through p...
Published on January 02, 2016 05:16
September 5, 2015
Management Benefits from using Microservice Architectures
Much has been written on technical costs and benefits of using microservice architectures. Also, we’re starting to see more management topics, such as prerequisites for implementing microservice architectures. For an excellent summary of needed prerequisites to implementing microservices, see Fowler’s “Microservice Prerequisites”. Among the prerequisites for succeeding with microservices is a dev-ops culture where environment setups and deployments are automated. You a...
Published on September 05, 2015 04:13
August 6, 2015
Exception Handling Issues for SOAP Faults with CXF Clients
The Apache CXF product is a wonderful product and for the most part it is easy to use. It's very common to use CXF to generate clients for SOAP services. Support for those clients for SOAP services that specify faults (the SOAP version of an exception) is not easy.
For example, when CXF generates exceptions for SOAP faults, which it does, it embeds details of the fault in a field on the exception that isn't reported in either the message or the stack trace. Thi...
For example, when CXF generates exceptions for SOAP faults, which it does, it embeds details of the fault in a field on the exception that isn't reported in either the message or the stack trace. Thi...
Published on August 06, 2015 02:05
July 11, 2015
Writing Microservices in Java
I've been selected as a presenter at JavaOne in San Francisco (Oct 25-29) this year. My session description is below. I hope to see you there!
Published on July 11, 2015 11:27
April 7, 2015
Making Bean Unit Testing Less Monotonous
Unit testing ordinary beans like value objects, transfer objects, or entities is the most boring coding one can be subjected to. Yes, it's easy, but it’s extremely monotonous.
The unit testing for beans like this do have value, but it’s limited. If you're manually coding tests of accessors and mutators, you can make an argument that the benefit might not be worth the labor cost. I've taken a different approach: let’s reduce the cost. Delegate monotonous coding to...
The unit testing for beans like this do have value, but it’s limited. If you're manually coding tests of accessors and mutators, you can make an argument that the benefit might not be worth the labor cost. I've taken a different approach: let’s reduce the cost. Delegate monotonous coding to...
Published on April 07, 2015 01:03
Making Unit Testing Less Monotonous
Unit testing ordinary beans like value objects, transfer objects, or entities is the most boring coding one can be subjected to. Yes, it's easy, but it’s extremely monotonous.
The unit testing for beans like this do have value, but it’s limited. If you're manually coding tests of accessors and mutators, you can make an argument that the benefit might not be worth the labor cost. I've taken a different approach: let’s reduce the cost. Delegate monotonous coding to...
The unit testing for beans like this do have value, but it’s limited. If you're manually coding tests of accessors and mutators, you can make an argument that the benefit might not be worth the labor cost. I've taken a different approach: let’s reduce the cost. Delegate monotonous coding to...
Published on April 07, 2015 01:03
March 23, 2015
Using Docker to deploy Java Web Applications
Docker has fast become a favorite deployment format. For those of you who haven't used Docker, Docker is "package once, run anywhere". Docker does for software what shipping containers do for tangible goods. It has standard connection mechanisms for disk and networking. Additionally, it's easy to link Docker 'containers' together (eg link database Docker container with your application).
Advantages and Disadvantages
Not only is it a win for system administrators as it ma...
Advantages and Disadvantages
Not only is it a win for system administrators as it ma...
Published on March 23, 2015 00:56
March 12, 2015
Project Estimation Tactics
I frequently asked for advice on how to estimate tasks or projects. It’s a question architects get asked by project managers as we’re often in the best position to provide a realistic estimate. Estimation is as much art as science, but there are some things you can do to reduce error over time. Some may argue that it’s not the architect’s job to estimate; it’s the project manager’s job. In my experience, it’s common to combine the architect and project manager roles, s...
Published on March 12, 2015 03:00
March 8, 2015
Preparing Public Maven Repository Releases
As a mature product, it *should* be easier to prepare a product release bundle for Maven artifacts. I had a hard time, both with a product that used Maven builds and one that did not. However, the purpose of this blog entry isn’t to complain, it’s to document the process. To be honest, my motivation to write this blog entry is really for my personal reference rather than public consumption.Resource RequirementsSonatype login to submit group creation requests (login available...
Published on March 08, 2015 01:35
March 6, 2015
Tracking Multi-Service Transactions with Correlation IDs
One problem that’s arisen with the use of Micro-service architectures is that there’s a need to correlate related transactions. With micro-services, it’s common for a business action of some type to require multiple service calls. If one of those service calls fails, sometimes it’s helpful to have context. That is, information about service calls for that action that preceded the error.
The best way I’ve found for doing this is to use correlation ids. A correlation id i...
The best way I’ve found for doing this is to use correlation ids. A correlation id i...
Published on March 06, 2015 17:19


