Learn by doing! When learning a technology, start by working on a project

Welcome!

Since I specialize in developing dynamic Web Applications in JAVA, ASP.NET and PHP (70% Server side and 30% Client side ), I am going to share a bunch of  tutorials which will include the above technologies and will ultimately lead to many small projects. Some of the things I am going to share here are -
  • Freeware and open-source tools and technologies.
  • Setting up a Windows XP based dev server and would also provide alternative resources for Linux and Mac OS. This will include: Installing Web server, App server, revision control system, continuous integration Server, Bug tracker, Wiki (Trac)
  • Setting up a dev workstation, Installing software tools to help develop Web Applications
  • Designing, architecting, developing and testing Web Applications

IronPython HOWTO export/copy ADODB recordset to excel spreadsheet

"""
Export or Copy ADODB Recordset to Excel Spreadsheet
@Author Surya Nyayapati
@Date Jun-25-2009
"""
 
import clr
 
from System.Reflection import Assembly
from System.Reflection import Missing
 
#From C:\WINDOWS\assembly Copied the Display name for ADODB
clr.AddReferenceByName('ADODB, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a')
from ADODB import ConnectionClass, RecordsetClass, CursorLocationEnum
 
connString = "DSN=myDsn;Uid=myUsername;Pwd=myPassword;"
 
conn = ConnectionClass()
rs = RecordsetClass()
conn.Open(connString)
 
conn.CursorLocation = CursorLocationEnum.adUseClient
query = "SELECT * FROM user_group" # Any SELECT SQL
rs = conn.Execute(query)
"""
#To iterate over Recordset
while rs.EOF <> True:	
	print "%s - %s" %(rs[0].Item[0].Name.ToString(),rs[0].Item[0].Value.ToString())
	print "%s - %s" %(rs[0].Item[1].Name.ToString(),rs[0].Item[1].Value.ToString())	
        # ...
	rs.MoveNext()
"""	
 
#Start a New Excel Instance
VSTOpath = "C:\\Program Files\\Microsoft Visual Studio 9.0\\Visual Studio Tools for Office\\PIA\\Office11\\"
 
#Load and add reference to Excel dll

Java Web Project File Structure

Earlier i showed and talked about how a badly designed web project looks like with its potential problems. Going forward, i am going to fix all that by starting from scratch.

Lets start with the most important step, defining the project file structure. Keep in mind that, there shouldn't be any duplicate jars and circular dependency, also it should be easy to manage. That's where Maven comes in. Maven makes your life so much easier that its not even funny (how i used to go by before i don't even wanna remember) because it takes care of downloading binaries (jar with source and javadocs) for almost all popular java libraries and tools like spring, hibernate, log4j, apache-commons etc. these are just to name a few.

Now, if you remember, last time we created the project using maven but it was a little tedious to create all those directories and poms by hand. This time lets make them automatically shall we ^_~

Howto create a dev server

From childhood i have always been fascinated by computers and my first box was a 386 machine with a monochrome monitor. Whereas now i have a powerful Quad core machine ^_^

I have a home network which connects couple of wired desktops, XBox (which is now a media center with XBMC) and also wireless iPhone and Macbook pro.

I have dedicated a box which is not publicly accessible to be a Dev server, and i recommend you doing the same. In this box i have Windows XP and the first thing i installed were Avira AntiVir (best free antivirus), SuperAntiSpyware and Microsoft BitDefender.

Howto write Java Web Application Project

I am going to start a series of articles to create a java based web application. The goal would be to write good quality and maintainable code which can also be unit tested.

We should always think that technology is going to be outdated. The project requirement and even the author will keep changing. We should design an application keeping these points in mind, and write code as loosely coupled as possible. There should be many reusable components which can be easily exported or copy pasted to other projects with minimum hassles. When using a framework, follow its standard convention with minimal configuration (if necessary). Also if a new person sees the code, s/he should be able to easily understand it. Good documentation is also good, but in my experience nobody likes to go through (or even write) a manual. So a good inline documentation and standard code convention with descriptive variables is very helpful.

In this part, my first step would be write a bad web project where every thing is tightly coupled. Business logic, model and presentation layer are all mixed up. This way, we will know what are the disadvantages first hand ^_^

Syndicate content