Adopting the hexagonal architecture pattern produces software that is more maintainable. It enables you to respond to changes with less fuss than many other architectural patterns. In this article I’ll explain why and offer my thoughts on this pattern.
What is a Hexagonal Architecture?
Alistair Cockburn first coined the term Hexagonal Architecture on his blog in 2005. Also known as the Ports and Adapters pattern, it is a layered architecture. It is a way of separating the domain concerns while making unit tests easier to write and changes simpler to accommodate.
Are microservices the same old SOA (Service Oriented Architecture)? Isn’t it just a rehash of the SOA hype? Let’s discuss the similarities and differences.
While microservices and Service Oriented Architecture (SOA) are two architecture patterns that deal with services, they have some differences. In fact, despite all the attention you see being given to microservices there are a couple use cases where SOA is the better choice.
So What Is a Microservice?
A microservice a stand-alone process that communicates with its clients using a lightweight mechanism, usually HTTP. Its datastore is a database of some sort. The service is the only application that interacts with its datastore. So let’s say for example you have a CustomerService that reads from and writes to the CUSTOMER table and any related child tables. Only the CustomerService performs SQL actions on those tables; any other services that do something with Customer information must go through the CustomerService using its published interface.
Should you use a target state architecture or an architecture radar for your organization? In this post I’ll explain what each one is. I’ll then highlight the differences between them. Finally, I’ll provide my opinion on which one is better and why I think so.
Many organizations, once they get to a certain size, see the need to decide on a particular technology stack. And rightfully so, because a proliferation of various competing technologies leads leads to an organizational drain. IT people need to become conversant and in most cases proficient at JBoss, WebSphere, and WebLogic if all three of these application servers are used. It means the organization ends up going “wide and shallow” across these three instead of “narrow and deep” on just one. In other words, they don’t develop a deep level of expertise on one application server, making problems harder to solve.
Note that this applies to programming languages, databases, application frameworks, and the key libraries an organization uses. It can also apply to server operating systems, routers and other network infrastructure, firewalls, etc.
So your team has developed and implemented the five principles of object-oriented design. You’re using Spring Framework as your dependency injection mechanism in your Java applications. You’ve tested the app, it’s been in production for some time now. But how is it doing? Is it healthy? Is it up and running? Oh sure, you can wait for a service desk call to come in, but wouldn’t it be much better if that call came in and you could say “yes, we’re aware of a problem and we’re working on it”? Some form of managing and monitoring your Java applications is moving from “nice to have” toward “essential”.
And when that ticket come in, your first thought. is to see if the app is actually running. You could check log files. You could log in to the app itself, oh wait, your credentials don’t allow you to log in to the production app. Is there a set of support credentials you can use? Where are they?
Humans are fallible. To err is human. These are noble assertions when it comes to living the human experience. But when it comes to application deployment, humanity is the weak link in the chain. In this post I’ll explain why and offer arguments in favour of automation.
We like to be in control. We want to make sure a process is done properly, and ultimately our bosses want to know we provided the necessary oversight. But how many manual deployments have you participated in when someone inadvertently omitted a step? Sure, you documented it clearly in the deployment instructions, and reviewed them with your implementers in the days leading up to the big deploy. Even so, that omission caused some sort of delay or worse, cause a data corruption. Now you are still there late Sunday night cleaning up the mess. There has got to be a better way.
Some software projects succeed, and others fail. What’s the difference? What are the clues that indicate whether a software project is going to succeed (or fail)? Here are four characteristics.
Number one, in order for any software project to succeed, it needs to solve a business problem. The magnitude of that problem, in terms of dollar value, needs to be greater than the money (time and effort) spent on the project. Otherwise, you’re just blowing an even bigger wad of cash.
Top Management Support
Number two, it needs the commitment and support of top management. Invariably there will be conflicts with allocation of people, time and money. Without this commitment and support, a loss of these resources can cause a project to be delayed, de-scoped, or both. The end result can be disappointing to the business customers. Having this commitment means having an executive on your side to advocate for your project.
Does it seem like you’re always waiting for something to be completed before you deploy your application to the User Acceptance Test (UAT) environment? You want to wait for the development team to fix the last few bugs. They have not yet agreed on which transaction manager to use. We’re only a couple days away from finishing feature X. We might have time to get feature Y in. There is no end to the myriad of details to sort out and questions to answer before you deploy.
Problem: You are developing a Grails application. You are using scaffolding to build out your views and controller actions. Yet for some mysterious reason Grails is not rendering some properties in the views.
Solution: Did you designate some properties as transient? If so, then by default Grails does not generate transient fields in views. To fix this you need to install the template plugin, and change the value of the persistentPropNames variable:
Install the view templates:
Now open the pertinent templates (list.gsp, show.gsp) in src/templates/scaffolding
Change the line that reads allowedNames = domainClass.persistentProperties*.name to allowedNames = domainClass.properties*.name for each template.
Note you are changing persistentProperties.* to just plain properties.*. This opens the door for Grails to generate fields in your views that include your transient properties.
Thanks to lo_toad for pointing this one out. This solution saved me so much time.
This describes how to use Subversion on a day to day basis. If you have inherited or been assigned to a software development project that uses Subversion, but are unfamiliar with how it works and how to use it, then this post is for you.
So What is Subversion?
Apache Subversion is a Source Configuration Management (SCM) system that has one central repository, usually located on a web server. Each of us works on our own copy of the Subversion-controlled project. When post our changes back to the central repository, Subversion merges them with the existing code and increments the Revision number. Anyone who then updates their local copy of the project will now see the changes we just made. As long as everyone performs frequent updates to their local copy, it all works fine.
What’s So Great About It?
Subversion uses the copy-and-merge philosophy, in contrast with the Lock-Modify-Unlock method used by older SCMs such as RCS, and Microsoft Visual SourceSafe (VSS). In these systems, only one person can change a file at a time, while everyone else is locked out. Veterans of RCS or VSS may point to a risk of running into conflicts and other problems when using Subversion’s copy-and-merge. While the risk of conflicts is still present when two or more people are working on a file, in practice this is only a concern when these people are changing then same part of a file.
If you could do something that would dramatically improve your job prospects in the event you leave your current employer, would you be interested? What if you could boost the value you deliver to your existing employer, and perhaps get assigned to that cool new project you heard about, would you be interested? Read on to see how you can use personal Continuous Improvement to boost your career…
A popular acronym in the software development world is CI – Continuous Integration – in reference to the practice of performing automated build and test every time someone makes a change to the software. But CI also stands for Continuous Improvement, an attitude that one never stops learning. It’s a constant pursuit of better ways to do things, of new skills to learn. The Software Craftsmanship movement has as its foundation the notion of continuous improvement.
Change is Constant
As we all know, information technology evolves at breakneck speed, effectively reinventing itself every three to five years. If we are to maintain pace with this revolutionary change, we need to keep learning, trying new technologies, and new languages. We need to have that sense of curiosity, of wonderment, of thinking “what if we did this…” and “what’s this “X” all about?”.
And if you don’t? Well, some may be able to stay with their current employer and effectively cruise to retirement. I’ve seen this work for some people. But then what happens if you are laid off, or otherwise need to leave your present employer? Your skills have probably stagnated, and become out of date. Your only hope is for a company to hire you who has a similar technology stack and development methodology. On the other hand, if your skills are in low demand out there in the marketplace, you’re in a world of hurt.
Boldly Go Forward
Take charge of your career development. Make yourself the one who gets you the skills and training you need. This is going to mean paying some costs out of your own pocket; however, you may be able to get some tax breaks here – speak with your tax accountant. Attend conferences, either local or out of town. Join your local Java Users Group or Meetup Group. All of this is an investment in yourself that pays off in many ways, not just monetary.
Mentor others in your newly-learned skills. Talk to your boss and offer to run a lunch-and-learn session. Look for opportunities to pair with a colleague to help solve a stubborn problem. Begin taking a leadership role when circumstances permit. Practice your own Continuous Improvement to boost your career and those of your colleagues. The personal satisfaction you get from sharing your knowledge with others is pretty cool.