Skip to main content

Posts

Design a scheduled report sender

Greetings! In one of my projects, I got an opportunity to design the architecture for a scheduled report processor and sender. As this is a legacy system, we used existing internal tools, and frameworks hence I'm not able to share the complete architecture but the general idea. This was one of those stressful but fun work. Existing system It can be represented as 3 tier architecture that is common for most of the applications. Design considerations As most of these kinds of architectures have similarities among them, what is important here is the thinking process as we are dealing with an existing system. No impact on the running application Independent development Asynchronous data processing Deploy separately Design I had to tweak the database a little bit but that is not important here. What is important is to expose a separate API for the data loader (ETL). ETL is triggered by a Cron job which eventually inserts into the queue for interested parties to use. Final notes This is ...

Designed a mini business rule engine, here is how

Greetings! When you are a passionate developer, you will always try to do better things, and experiments with new things. In this article, I will explain how we achieved a complex code cleanup by creating a mini business rule engine. Why is it? There is business logic depends on each other due to business behavior, mainly due to years of development. The business knowledge of the behavior is missing. Problem statement This legacy module has been developed a long ago and new codes are also a copy of those codes. I see numerous issues there. Business knowledge is missing (Logic is hidden everywhere) Unmanageable codes due to years of development Complex logic The main APIs (multiple) depend on this Two domains are coupled New joiners cannot understand the domain Error-prone due to fragile codes How to approach As there are higher-priority tickets in the backlog, it is difficult to prioritize this kind of work as it ...

How and why I designed a business validatoion framework

Greetings! Business validations are a crucial part of any application. We faced use cases with too many validations. It is hard to maintain and extend the solutions with such a number of validations. This is when I thought to try a solution even though there was no such task in the backlog. Hence I used my own personal time for this. Features Execute a larger number of validations in single use case Reusability by sharing the same validation in different use cases Skip non-mandatory validations by user choice (yes/no dialogs) Expose validations via REST API Extendability by adding/removing validations No performance impact Easy to use in future developments It all started with an Interface My quick solution was to introduce a common interface by utilizing Java generics and Java 8 new features. I did not have all the features in mind when introducing this. However, that is the power of having a proper interface. public interface Validator<T> { void vali...

Design a meeting event scheduler

Greetings! I got a chance to work on a project where we had UIs for meeting schedules and later improved it to sync with external calendars as well. In this article, I am sharing my general ideas on that design. The main business requirement is to access meetings anywhere whether from our system or an external system. (It is a different domain, for the article's purpose I refer to these as meetings) Initial investigation I took a decision to make this a normal meeting request just like Google calendar as making this a meeting event would be more appropriate and user-friendly. My co-worker did the initial investigation on iCalendar format which is standard for calendar clients. We found that sending a meeting request is an email with the header "type=calendar". Initial investigation and the proof-of-concept is done! Let's define the main components. Main components We could complete this by adding simple classes/logic. However, that is not real engineering. Hence, I de...

How and why I designed a meeting (iCalendar) library

Greetings! Have you ever thought about how to send a meeting event programmatically? In one of the projects I worked on, there was a requirement to send the appointment information to the user (in addition to visualizing it in our UIs). This is when I thought to do this as a meeting request. How can we do that? We learned that these calendar applications follow a standard format, that is "icalendar". Now my job is to create these .ics files. We investigated a few existing libraries as well but I was not happy with them as I wanted to send it as a meeting request but it did not work with existing libraries. At the same time, we have a lengthy process when introducing new libraries. Hence, why don't I build my own library 😉? What is iCalendar? The iCalendar is the standard specification for calendaring and scheduling events. It allows users to store and exchange calendaring and scheduling information such as events, to-dos, etc. According to the specification u...