Experiencing Java

Tuesday, October 31, 2006

Book: Professional Apache Tomcat 5

Why this book?
I just implemented a part of a simple Shopping Cart application and tinkered with it. When I changed something in the Java code and produce new class, I expected to see some changes in the browser. But it didn't.
Being new to Apache Tomcat, I just, out of a whim, reload the application using Tomcat Manager. And voila!
By starting with this book, I hope to know more about Tomcat, which will help me with the projects in Beginning JSP book.

Sunday, October 22, 2006

Book: Professional Java JDK 5 Edition

Why Reading This Book?
The book itself claims that it is the continuation of Horton's book or any beginning books on Java. It aims to bring the readers one step further from the fundamental knowledge of the language and prepare them to use tools, methodologies, practices and APIs.

What to learn:
  • The new features of Java language
  • Principles, habits, development methodologies, & Development scenarios (ANT, Maven, JUnit, XDoclet, JMeter)
  • Important Patterns:
    • Adapter, MVC, Command, Strategy, Composite


Good Points and Quotations:

Tools: Java Editors /IDE

I have tried a lot of editors for as long as I have been programming. I can't remember them all. The ones I mention here are still with me:
  1. Eclipse
    • I like this IDE. It is not daunting as happened in my previous experience with IDEs (old version of Visual Studio, etc). May be they are just maturing together. I haven't used VS since.
  2. JCreator
    • Good one. Knew it from Ivor Horton's Beginning Java (Am I right?)
  3. Notepad++
    • Used this extensively when I took the scripting course in UiO. I used it for writing Python and Perl

Book: Beginning Java Server Pages

Why Reading This Book?
I was asked how to create a simple web access to database and present it in a html page. The answer is by using a servlet which will take care of the GET and POST command, as well as accessing the database. Servlet, that is it. By reading this book I hope to find out more about.
Also, this book contains two projects: (1) Personalized Portal and (2) Shopping Cart Application.
It sounds good, isn't it? Well, at least something useful :)

What Do I Learn From This Book?
  • I have just been introduced to the Tags. I think it has a lot of potentials. Let's see.
  • How to show which browser the user is currently using:
    • Create a tag consisting this: ${header["user-agent"]}
  • JSTL(JSP Standard Tag Library): support for common, structural tasks such as iteration and conditionals, tags for manipulating XML documents, internationalization tags, and SQL tags
  • (31/10/06):
    • Implement an interactive catalog showing categories of products
    • Implement a working shopping cart
    • Use Java objects as attributes to pass information between JSP elements or multiple JSP pages
    • Use implicit JSP objects that support attachment of attributes, and the lifetime of these implicit objects
    • Scoping
    • Session

What Have I Done?
  • I now already installed Apache Tomcat server. (Yoohoo!!)
    • Previously it was version 5.5.16 --> problem running JSP examples
    • Installed the latest version 5.5.20. In the installation process apparently there is an option to deploy the JSP examples and Servlet examples. AKA install full.
    • May be I didn't do that with my previous installation

Good Points and Quotations:
  • JSP is a presentation-layer technology (p.28)
JSP Best Practices:
  1. Use the simplest HTML to prototype your application before adding style and layout
  2. Separate JSP development from HTML layout and formatting as possible.
  3. Pattern: Attaching an attribute to an (implicit) object --> in the declaration part, to be retrieved during processing by the JSP. (p.86)
    getServletContext().setAttribute("cats", EShop.getCats());
    Later,
    ArrayList cats = (ArrayList) application.GetAttribute("cats");

Saturday, October 21, 2006

List of Projects


Don't do a project where you don't think you'll learn something on the way. Jim Coudal, Keynote Speech, SXSW 2006
This is a list of projects. Aimed to practice what I have learned. Items to be recorded are: description of projects, what is learned, and possible extension.

Large Projects


Small Projects(Exemplary for a concept or idea):
  • The Imager (Proffesional Java, p.225)
    • Some sort of image editing and drawing program (without the imaging part :-) )
    • Demonstrate different strategies for persisting application data using APIs: Java Serialization, XMLEncoder/Decoder, JAXB

Book: Bitter Java

Why This Book?
I used this book as a sample for my translation company. Tried to offer this to some IT book publishers in Indonesia. Didn't seem to work out well.
In one conversation, an experienced developer asked me what this "Bitter Java" is. I was surprised that this thing is not known so well as I thought. I simply answered that it was about antipattern. No clear idea of what it was, I decided to start on this book more closely.

What Is In The Book?
  • What is antipattern anyway?
    • Obviously it is the opposite of pattern. Pattern can be used to teach programming constructs or ideas which produce positive results. So, antipattern is to teach programming constructs or ideas that produce negative ones.
  • Bitter Java concentrates on antipatterns in server-side programmings.

Good Points and Quotations?

Friday, October 20, 2006

Book: Beginning Algorithms

Why reading this book?
In a recent job interview, I was asked about a simple thing on algorithms. This is such a basic subject which I dont remember about it anymore. I know that it is important for an IT practitioners to know those things. However, when I learned it at campus, it was just not stimulating enough for me to enjoy it. There is a gap between this pure academic stuff with the on going technological development.
This book, however, promises that it will fill the gap. I am counting on it, and in my next job interview I will not repeat that stupid mistake again.

What is in the book?
It seems like it covers a range of topics, i.e. the basic concepts needed to understand this subject (complexity, Big O notation), basic data types, more advanced ones, sorting algorithms, etc.
Another things which they mentioned very early is the use of unit testing (JUnit). I am really curious about it.

Good Points and Quotes:
  • "test-driven development (TDD), forces us to concentrate on the contract, the published behavior, of our classes, rather than the implementation" (p. xxiii)
  • "Another benefit of unit tests is that they provide reliable documentation about the behavior of the class under test."(p.11)
“To understand recursion, we first need to understand recursion.”

Cross References:
  • About JUnit in Eclipse: See Daum's Book, Ch. 6, p.120
    • Should I use the JUnit test that comes along with Eclipse? Or install by myself in for my own project? Or can I use both?
    • Consider the way the testing package is organized in this book!



List of Books

He listens well who takes notes. (Dante Alighieri, The Divine Comedy)

This list is intended to gather and manage my scattered habit of reading good books. When it is scattered I was usually left feeling that I haven't accomplished anything. This is bad for prospective employer. This list will be updated from time to time.

Anyway, here they are:
  1. Professional Java JDK 5 Edition, Richardson, et.al, Wrox, Wiley 2005
  2. Professional Eclipse 3 for Java Developers, Berthold Daum, Wrox, Wiley 2005
  3. Beginning Algorithms, Simon Harris & James Ross, Wrox, Wiley 2006
  4. Ivor Horton's Beginning Java 2 JDK 5 Edition, Ivor Horton, Wrox, Wiley 2005
  5. Bitter Java, Bruce A. Tate, Manning 2002
  6. Beginning Java Server Pages, Chopra, et.al, Wrox, Wiley 2005
  7. Professional Apache Tomcat 5, Chopra, et.al., Wrox, Wiley 2004