Friday, 18 July 2014

Spring JDBC connection with jdbcTemplate and JdbcDaoSupport


Hello! Today I want to make a couple of examples of database access using JDBC within Spring framework. In this article we'll see how DB's manipulations can be  simplified using jdbcTemplate and JdbcDaoSupport.

Cute image from me:
If we don't use jdbcTemplate we must again and again, in every method, repeat yourself writing duplicate code for opening and clothing connection to DB, etc.

Why? I really don't understand, this solution is opposite to the one of OOP design principle (DRY: Don't Repeat Yourself). If you use some code more then ones - then you must detach it to a separate method and invoke it every time you need in the future.

Spring developers offer us to avoid repeating yourself and use jdbcTemplate which can do all redundant work for us.

Let's see the differences!

Monday, 7 July 2014

Script debugging in browser (JavaScript + Chrome example)

Hello! Time for the next debugging mini-lesson. Today I want to give you an additional information about debugging web-app. If you have some JavaScript (or other scripts) on your page it is very simple to debug it in familiar way.


All you need for this lesson - Chrome browser and some working project with couple of JavaScript lines inside.
I am using my pet-project to make some clear images for you.

Friday, 27 June 2014

Remote debuggin WEB applications with Intellij IDEA and Tomcat

Hello! Today I want to introduce you to the one great feature, a lot of young Java padawans don't know about!
Let's start from the traditional funny image:



All IDE users certainly know about a debugging console applications. But what about the debugging WEB-app? Wow, it is a real magic, we can simply press some button on your web-site and immediately jump to the first breakpoint, your program goes through. And we can march over our code within IDE in familiar way!
Oh! I was really inspired when have been told about this approach for the first time!

And today I've prepared some screenshots for you. Next we'll speak about remote debugging in Intellij IDEA with Tomcat.

Tuesday, 24 June 2014

Spring MVC Java-based Configuration without any XML

Hello! What is the reason to use Java based Spring configuration instead of familiar XML config? I can describe it simply with the next slide:


In my opinion XML is a legacy part of java application and  it is much better to use Java in Java app :) What do you think?
Today I want to make a  review of Java config in Spring 4 with all  benefits of using Annotation approach!

Friday, 20 June 2014

Layers in MVC web application

Hello! Today I want to make my first post and it will be focused on basics of WEB app layers. Let's start!

When I just started to write my first web application, based on Spring Framework, I was told about web app layers and their interaction.

Actually at first I haven't understood and I've spent a lot of time making mistakes, rewriting wrong code and etc...
But finally I've got it (I think so :)). At least now I can build simple web application and think that I've done it correctly.
It's a good feeling. It's like touch something great and feel yourself like little Architect :Р

And now I've got together this basic things in funny table and I want to present it for you...




Thanks for img src: http://freedesignfile.com 
License: Creative Commons (Attribution 3.0)