When people read about SOLID, they tend to think that SOLID is about writing the better code. It’s not. SOLID is about shaping the developer’s thoughts and revealing the uncertainties.
Home | Archives |
When people read about SOLID, they tend to think that SOLID is about writing the better code. It’s not. SOLID is about shaping the developer’s thoughts and revealing the uncertainties.
S3 is a popular choice when you want to host a static website. Often, “a website” means a public website. But not all websites are made to be public. If you tried googling the options to restrict access to the website, you’ve probably seen the recipes like restricting based on IP addresses or even 3-rd party services.
IP address-based approach doesn’t work for me, because I often work from home and I definitely don’t want to whitelist my ISP’s subnets. The 3-rd party services are by default to be avoided when it’s about security. So I had to look for alternatives.
What I find most interesting about AWS, is that there’s no distinction between “normal services” (e.g. DynamoDB) and “infrastructure services” (e.g. CloudFormation). In both cases there are APIs. Your code can use the DynamoDB API to save the data, as well as it can use the CloudFormation API to understand which componets your system consists of.
Javadoc comments are a nice approach to documenting the code. By following a specific comment structure, you can describe what the classes are responsible for and what the methods do. Many developers use the standard javadoc tool to generate documentation.
But what if your client asks for custom documentation? In this post I want to show how QDox and Asciidoctor make it a straightforward task.
Developers care about the code they write. They build tools that enforce spaces instead of tabs, forbid 1-letter identifiers and ensure that every class and method has Javadoc comments. One example of such a tool is Checkstyle.
But usually, it’s not code style violations that makes code hard to read and maintain. More often, it is higher level code organization (software design) – all the decisions made about classes, their responsibilities, connections between them, etc.
Tools like Checkstyle surprisingly won’t help you to avoid making your view layer go directly to the database. In this post I want to show how to implement this kind of design constraint by building a custom Checkstyle check.
I’m a big fan of Markdown. I really love this idea of lightweight markup – you write plain text, mix it with formatting instructions and get your text formatted. I like it, because it feels very similar to writing the code.
Asciidoctor is another lightweight markup processor. It’s similar to Markdown, but more powerful – it can do more than just making your text bold or underlined. Asciidoctor is what Spring team uses to write their documentation.
One of the annoying things about writing Selenium tests is that you must ensure to only interact with the page at the right moments of time. Buttons tend to trigger asynchronous operations, so after you click a button, you should wait for the this operation to finish before you go any further.
The common practice is to poll the DOM – “as long as this spinner element is visible, operation is running” (WebDriverWait
). However, in different scenarios your spinners may be different DOM elements and sometimes you may not have a spinner at all, which makes this approach harder to implement.
Protractor somehow handles asynchronous operations transparently. How does it do it?
A good way to verify application quality is end-to-end testing (E2E testing). While unit tests verify that pieces of code work correctly, E2E tests verify how the system works as a whole – they span the entire application from buttons to database. If unit test is green, well… it does not mean much. If end-to-end test is green, it means that system works to some degree.
Back in 2013 I realized that I don’t have a public CV and decided that I need one. I did not know what was the best way to get it, and I wanted it to be not a one-time creativity act, but a reusable solution.
One of the popular options to deploy something nowadays is git-based deployment (Github pages is a good example). Here’s a recipe to push some content to the remote branch ignoring whatever this branch already has: