3 ways to bootstrap Spring applications using Spring Boot

Spring Boot is the framework under Spring projects umbrella to bootstrap Spring applications. It provides few ways in which you can create a Spring application e.g GUI, CLI based.

Using Maven 

This is bit old fashioned but you will get to know what is really going under the hood. First create a normal maven project in Eclipse. In pom.xml add the spring-boot related dependencies you want to use in the project.

SPRING INITIALIZR

Go to the site start.spring.io This is the official Spring site for bootstraping Spring applications. You can select the various options whether you want to use Maven or Gradle and the Spring Boot version.

Fill the Group, Artifact, Name, Description for your project.

Add the required dependencies by adding the appropriate keywords e.g. Web, Security etc.

If you want to fine tune your dependencies, switch to full version. There are many categories you can choose dependencies from e.g. Core, Web, I/O, SQL, NoSQL etc.

Upon click of Generate Project, project will be downloaded in zip format. Import this to your favorite IDE and start writing your business logic. 🙂

Spring Boot CLI

If you are more of command-line fan, Spring also provides CLI utility for creating Spring applications using Boot.

You can download the latest version of utility from here. Extract the zip file in your file system and include that path in Windows PATH Environment Variable, so that you can run spring commands from anywhere.

Spring Boot CLI provides spring command to execute Spring Boot Groovy scripts.

Syntax

spring run <SpringBoot-Groovy-Script-Name>

Let me know in comments which is your favorite way to create Spring applications. 🙂

Deploy Spring Boot app on Heroku from Github

Spring Boot is the latest trend for bootstrapping Spring applications.

Heroku is a PAAS(platform as a service) that enables developers to build and run their applications in the cloud.

First thing you need is Spring Boot application that is checked-in to your Github account.

You can create Spring Boot application from start.spring.io or using your favourite IDE.

spring-boot

You need a heroku account to deploy your applications in the cloud. It offers many tiers but also has a free tier which you can use to test your applications.heroku-plans

After creating Heroku account, go to dashboard to create a new app. You can choose any name or heroku will fill in some random app name.

heroku-new-app

Click Create App button. It will take you to next page where you can configure your application.

You can select deployment method e.g. Heroku CLI, Github, Dropbox.

Upon selection of Github, it will ask you Github credentials. You can select the repository you want to deploy.

This also gives the option of Automatic deploys which will deploy your application if you push code to specific branch say like master branch. Make sure this branch is always deployable if you are using this option.

You can also deploy manually by clicking the Deploy Branch button.

Github Repo : https://github.com/kuldeepsidhu88/spring-boot-heroku-sample

Heroku URL : https://spring-boot-heroku-sample.herokuapp.com/

https://spring-boot-heroku-sample.herokuapp.com/hello

Let me know in comments which is your favorite PAAS provider 🙂

My thoughts on book – Soft Skills by John Sonmez

I have been following John’s Simple Programmer  site since one year. I have not subscribed to it but I used to check for new posts once in a month or so.

I always wondered whenever I came across these kind of blogs having useful posts for programmers, like why can’t they write a book covering similar topics. I always thought if book would a difficult and time consuming task, at least they should create a pdf of blog posts so that people can download and read it easily and also able to read when they are not online.

My problem, many of you may have, with reading blog posts is that I always try to read as many posts as I can if it happens to be blog I am visiting for first time and has posts of my interest.

Sometimes, while reading comments on some blog post I actually end up being on some other blog which is having lot of posts and story continues.

When I got to know about Soft Skills , I was really glad for at least one blogger has written a book I have been waiting for.

Coming to my thoughts about the book –
This book has been divided into seven sections. And I must say sections which any developer, other professionals also, should aware of despite having technical or domain knowledge.

Each section is having various chapters related to the main theme of the section. Each chapter is like a long blog post. It cover one topic as a whole. I liked this.

Whenever you have little time, you can start reading and finish a chapter. This was very helpful as most part of book I have read while travelling to office and coming back home.

Sections related to Marketing Yourself, Learning to learn and Productivity are my favorites.

In Marketing Yourself section, John puts emphasis on creating a personal brand. He explains about the benefits of personal brand. He encourages you to start with creating a blog. Book is having various chapters dedicated for start blogging and getting more traffic.

He is additionally having a free, 3 week, email course on his site to start blogging.

In Learning to Learn section, he explains 10-step process for learning anything.

In Productivity section, he talks about techniques to improve productivity.
I like the Pomodoro technique the most.

It is a technique in which you set a 25 minute timer and focus just on one topic. Once timer is up you can have a short break for 5 minutes. The technique is based on the idea that regular breaks can enhance mental readiness.

You can easily find mobile apps and pomodoro timers online to keep track of your time.

Apart from above, book also has sections about Career, Fitness, Finances and Spirit.

This book would be a good read for every software developer.

I would be very happy if John had also included topics on significance of certifications and side projects in one’s career and how to get ideas and mange time for side projects.

Please share your views about the book.

Happy Reading!

Migrating from iOS to Android

I have recently migrated from iOS to Android. Here i will be listing down the links i found useful for moving content.

Contacts
Contacts can moved easily if you have already synced them to iCloud. Just export the contacts from iCloud account and import in Google Contacts. More info –
http://www.ubergizmo.com/how-to/how-to-transfer-contacts-from-iphone-to-android-5-ways/
http://www.hongkiat.com/blog/transfer-iphone-contact-to-android/

For moving messages and Whatsapp messages, first you need to take a backup of iPhone using iTunes.
Messages
http://www.hongkiat.com/blog/transfer-iphone-sms-to-android/

WhatsApp Messages
http://www.wazzapmigrator.com/

For the above link you need iTunes backup extractor, you can found the same at

http://www.wazzapmigrator.com/faq/free-itunes-backup-extractor-windows

Apps & Games
For apps/games, you have to manually search and install from Google PlayStore.

How to assign a drive letter to folder in Windows

Command – subst

This command is quite handy when the folder you want to access is very deep. It will assign a drive letter to the specified folder.

Steps :

Open command prompt.

To assign a drive letter

C:\>subst E: "C:\>Users/xyz/Downloads/Movies"

– 1st argument is the drive letter you want to assign

– 2nd argument is the folder path

To delete the drive

C:\>subst E: /D

To see the list of drives created using subst command

C:\>subst

Output:

E:\: => C:\>Users\xyz\Downloads\Movies

 

References:
https://technet.microsoft.com/en-in/library/bb491006.aspx
http://www.computerhope.com/substhlp.htm