Posts

Implementing common application headers using Maven Overlay

Image
Many web applications these days are not really a single deployed instances, they are a set of applications (.ear files) deployed in different application server instances. Typically the developers divide them based on the tabs or functionality. For example, the landing or overview is one deployment, where as, billing and reports could be separate deployment and so on. But one thing which will be common in all these individual applications would be the application header (i'm not talking about http headers) which shows the page navigation. This header can have multi-level navigation structure. When user click on say Billing tab which is deployed in different app server instance, the request goes to that new server, new session gets created and page will be rendered with its own headers. The look n feel of this Billing page header would be kept same as Overview page, to make this transition unnoticeable to user. For the above purpose, the developers end up in implementing the same h...

Considering using Java Variable Arguments

one day i came across this situation, we have a Java project (LoggerCore) which is a common project used by many other projects. I had to modify a method signature in LoggerCore project, but was afraid that i would end up cascading changes in all the projects to satisfy java compiler. Started thinking that there should be someway to modify my project and common projects with out touching other projects which also use this common one. Suddenly it flashed while driving home, Java Variable Arguments. Let us have look at the code snippets: public SpringBrainLogger logIt(String referenceNumber) { ... } This is the original method signature in LoggerCore project, if I have to pass extra information, i need to add new argument and add it through out its reference. How tedious? Easily error prone! public SpringBrainLogger logIt(String referenceNumber, LogInfo... info) { ... } Intead, I considered doing this. I added LogInfo... info which is Java variable argument syntax. Boon: - Dont hav...