Posts

CAP theorem proof

https://www.youtube.com/watch?v=Jw1iFr4v58M 

Spring Boot start up Maven Failure

Sometimes we get weird error that Spring cannot read manifest file from .m2 location. If you browse, you will get the jar and find the mf file. To resolve the issue do the following From Eclipse/STS - right click on the project and choose Maven build. In target type dependency:purge-local-repository -DreResolve=false and run. or open command prompt/bash shell, go to the project directory and run the following maven command to delete the cache mvn dependency:purge-local-repository -DreResolve=false

Spring Security Hiccups

In any web-application some pages are secured (only logged in and authorized users with proper role can access) and some pages are not secured such as login or landing page. But sometimes we need a mix-n-match, such as some information user can view without proper access(login) but they need rights(such as login) to perform additional activities. here is an example - in amazon or any retail site you can view products, but you need to login to buy the product - the buy now button will ask for your credentials.  Images, css , Javascript dont require security < sec:http pattern = "/css/**" security = "none" /> < sec:http pattern = "/gwt/**" security = "none" /> < sec:http pattern = "/images/**" security = "none" /> < sec:http pattern = "/img/**" security = "none" /> < sec:http pattern = "/scripts/**" security = "none" /> Logon...

JPA Vs SpringJDBC

Recently I conducted many interviews for my employer, one 8-9 yrs exp candidate asked me what data access object layer do we use in our project. I was thinking a bit as , like they do with persistence - polyglot persistence, we maintain different DAO technologies - JPA, proprietary JDBC, JDO, Spring JDBC. you cannot say which one is the best. It depends on the context but definitely having so many things for performing dataaccess is not advisable. In this topic I will try to explore the JPA and Spring JDBC. Spring is a life savior, it's template concept reduces the boilerplate code but still the jdbc template comes with baggages - row mapper, SQL, parameters etc. If you have good knowledge of database schema, you want to execute stored procedure, you want more handle on your code to access the db. Then go for Spring, you can debug easily and have control on your DTO. If you need to abstract away the SQL, hide complexity, write less code, dont need to execute the stored proced...

ElasticSearch multiple strings in multiple fields search

I was working on an ElasticSearch(ES) POC to store millions of database entries to ES and search for multiple strings in multiple fields for all these entries. Let me explain the problem in depth - we use different defect tracking tools such as Rational CharmNT, JIRA and so on, to log defects. In defects we update the exception trace to identify the logs. For example - a stack may look like Exception in thread "main" java . lang . NullPointerException at com . mycompany . myproject . Book . getTitle ( Book . java : 16 ) at com . mycompany . myproject . Author . getBookTitles ( Author . java : 25 )   Similarly another stack may look like Exception in thread "main" java . lang . NullPointerException at com . mycompany . myproject . Course . getSchedule ( Course . java : 162 ) at com . mycompany . myproject . CourseDao . getCourses ( CourseDao. java : 50 )   So, we when a tester sees a NullPointerException he will log the trace t...

Requirement Engineering

Try this with your buddies- Take a picture of a crowded road Ask a friend to depict the picture in paper Pass the paper to another friend and ask him/her to draw the picture using the description Let me know how it goes :-)

GWT, MVP and Eventbus

I have been using GWT and MVP for 2 years and so. I loved the way MVP provides flexibility of working with multiple views. In GWT or Swing based application design muddles very quickly.  Maintenance becomes nightmare. We don’t think about the separation of concern, then mix up the UI code and business logic together. MVP (Model View Presenter) proposes following things - ·     View is an interface which is a contract for presenter. here you can define the operations and expose widgets that will be present in the UI. for example if an UI needs an input box for user name and  a  button then you can expose two methods getName() and getOkButton().  Get name can be implemented using whatever widget user wants- a textbox or a custom widget. ·     View implementaion implements the view interface and only concentrate on layout or grouping of widgets. Doesn't perform and logic, doesnt attach any DOM handler to any wi...