I started writing my first spring and the first springboot application today. The project requires mongodb and mysql as databases. My application’s domain objects are highly hierarchical and we need to make different kinds of search engines for many child classes. So, there needs to be some violations from common patterns like “field shadowing”. Though it’s only for the purpose of data and search layer, it doesn’t affect the object model of the application. So, I needed to change field behavior in subclasses which are different entities or collections in Mongo store. Basically I needed to put a annotation on subclass to enable an index on a field.
Handling null can be problematic in code organization and management. So, there are two very common patterns used by experienced developers now and then. One is “Null object pattern”, where you return an object which states a missing object, and another is “Special Case Pattern”. This article is to “How you can write effective objects for those patterns and why you should use them instead of returning null or throwing exceptions”
I read through many discussions related to Singleton Patterns, and different developers dislike it for different reasons. Not all the reasons make a pattern evil, because many of those reasons doesn’t really make your software really bad. I will be writing here each of the reason, and try to explain whether the reason is justified to call Singleton Evil:
I would enlist here the list of articles which explains why DI is important in designing software today satisfying a few goals like
- Code management
- System learning curve / Ambiguity Management
- API Dependency management
- Application Life Cycle
Interfaces were built to create public API and minimize client code to access fungible objects. I do use interfaces heavily for all the purposes you probably are familiar with. Today I would like to introduce a new and opinionated way I am using interfaces which helps me to create consistent structures of similar classes.
Yes, these are not the same terms, and I would say they are quite different in modern software architecture. It’s very frequent to see asynchronous and non-blocking terms are used interchangeably. Especially, when creating a thread to do some background task and letting the calling thread to continue without waiting for the new asynchronous thread.
But non-blocking now has a very deep meaning, better be said as “how much blocking our applications are”.
Today I needed to dynamically modify wordpress navigation menu from a custom plugin depending on some conditions. I couldn’t find the solution. So I read the codes which renders navigation menu on wordpress to remove some items from menu on-the-fly:
I was setting up my wordpress development environment in windows today. I wanted to have php unit tests for the plugin I have been developing for a few days, and I ran into an article which says wp-cli.phar cannot be used in windows! The article was about using PHPUnit to write wordpress plugin unit tests.