Tuesday, July 03, 2012

Post#2 Working Through Basics

And I thought that I could just walk over to business use case and crack it. Typical developer mindset. Every developer novice or retired thinks that he can develop the functionality in super fast time. Some really great developers do deliver faster than eye can blink, but a vase majority of them just set themselves up for failure. 


I know this lesson as a manager. I learnt it several years ago. Well its time to revisit that. The developer in me stands chastened by the manager in me. Developer me Hates the Manager and the Manager feels exasperated by simplistic life view of the developer.


Step 1 of getting to Accounts Set Up is to fetch the Master Data. That's about 2% of the use case. Of that getting bank data is 20%. Ha! But just implementing that 20% of 2% is such an education. 


Traversing that path took me through so much learning. I learned about getting multiple rows through Spring NamedParameterJdbcTemplate and RowMapper. The RowMapper gets just 1 row. But used in conjunction with List NamedParameterJdbcTemplate.query(dbCon,Map,RowMapper) it can fetch multiple rows.


While developing the code I researched the net several times. The top 3 sites I've constantly found useful are
StackOverFlow.com trouble shooting and quick ref
CodeRanch.com for trouble shooting and quick ref
mkyong.com For good hands on learning
viralpatel.net Spring MVC concepts  Desis contribute to the world too :)
krams915.blogspot.com Great Learning Experience on spring MVC security
roseindia.net 101 for beginners


In the ancient web development world of servlet and jsps (back when I last coded). This would be a 2 step process. 
Step 1 - You have a controller servlet which works as the traffic cop (authentication and authorization) and then sends it over to the jsp.
Step -2 The jsp would invoke all the pojo's needed and you'd use jsp tags to render the page. All reusable jsp was stitched together using jsp:include. You had to take care of closing the db connections (you could write util classes that addressed the connection leakage issues). And you'd be done.

In this new world everything is encapsulated. The frameworks are Robust but the learning curve is steep.
So 
- I created a controller using @Controller. Added @RequestMapping
- I set up Spring MVC Security and created authorization levels (Took a lot of time)
- I configured the web.xml and server.xml for db connection.
- Updated  dispatcher-servlet with pojo wirings
- Wrote the jsp

Midway I changed some packages and used application refactoring to update references. Well its not foolproof because somehow it forgot to update spring-security.xml and the server refused to start up. Some head banging got it resolved.

So now finally I can see the masterlist of banks! Hurrah! 



No comments: