Spring Web App Banking Example

This article shows how to quickly build a web application using the Spring Tools Suite. For this tutorial, I use Spring Tools 4 for Eclipse, where I initialize projects using Eclipse wizards. Spring Boot Web Application Spring has a lot of components, and SpringBoot is a convention over configuration approach Read more…

Java Array Exercises

This article contains a series of exercises on java arrays, including resizing array implementation, merging sorted arrays, etc.. Resizing-array implementation A Java ArrayList is a resizable-array implementation of the List interface providing amortized-time for insertion of O(1). Exercise: implement a ResizingArray class providing O(1) amortized-time for insertion. Growing the array Read more…

EMF Modeling and Code Generation

This article shows how to quickly build an EMF model using the Ecore Tools UML editor and generate the Java source code. For this article I am using eclipse eclipse-modeling-tools-2019-06. Modeling Motivations Main motivations for modeling and code generation: separation of application logic w.r.t. implementation: your independent model can be Read more…

Maven multi-module in Eclipse

You use maven in Eclipse, and need to work with multi-module (hierarchical) projects? This page shows how to create and work with maven multi-module projects in Eclipse. For this article, I am using eclipse-jee-2019-06, which already supports maven. If you use a different version of eclipse, make sure the m2e Read more…

Maven basic examples in Eclipse

Here are three examples covering maven basics in Eclipse such as: convert a java project to maven nature, create a project with an archetype selection, and refresh/update projects and understand files and structure. For the article, I use eclipse-jee-2019-06, which already provides maven support. If you use a different version Read more…

Java 8 streams

Notes on practical usage of Java 8 stream filtering. Stream Filtering A Stream<T> references a sequence of T values, and exposes a set of aggregate operations we can use to manipulate data in a pipeline. As an example, we can find the name of any people older than 20. In java, you can loop Read more…

Parsing XML with Java

Here are some notes on parsing XML file with java to extract information Simple Example Assume we have an XML file and we want to extract specific attributes. A sample file could be: With XMLStreamReder Here is the code to quickly scan the XML file and get the values for Read more…