5 articles Java

Java Collections – HashMap and HashSet

HashMap and HashSet are collections in Java which are most commonly used. Here we summarise key features: HashMap   HashSet Duplicates Yes, Duplicate values but  no duplicate keys No Adding or Storing mechanism Hashing technique HashMap object Dummy values No Yes Implements Map Set Number Of Objects required during add operation 2 1 When to…

Alfresco Services Public Java APIs

Public Java API services The Public Java API provides access to Alfresco through a number of services that are exposed. These services are accessed via a single point of access – the Service Registry. This information provides an overview of the services exposed by the Public Java API. The following table summarizes the main services…

Java tips – Avoiding null checks in java

One of the worst nightmares for java developers ( from junior to experts ) is null object reference checking. I’m pretty sure you have seen several times code like this public void addAddressToCustomer(Customer customer, Address newAddress){ if ( cutomer == null || newAddress == null) return; if ( customer.getAddresses() == null ){ customer.setAddresses ( new…

Single Page App with Spring and AngularJS

Spring is a very comprehensive framework for Java and is ideal for backend serverside functionality of an application. It supports RESTful services and I will show how it can be integrated with Angular JS, a front-end client side Javascript based framework. RESTful api’s can be built independently by building a controller, service factory and a…

JDOM – Processing XML

JDOM is an open source Java-based document object model for XML that was designed specifically for the Java platform so that it can access, manipulate, and output XML data. JDOM integrates with Document Object Model(DOM) and Simple API for XML (SAX), supports XPath and XSLT. It uses external parsers to build documents. It has been part of the Java Community Process as JSR 102, though that effort has since been…