Sunday, February 25, 2007

Dojo session on Generics

Today we did a dojo session to practice Generics. The exercise was a simple expense tracking system. The goal was to understand how to use the Java collections libray with type information.

The following students participated in the dojo:
  1. Ashish
  2. Abhishek
  3. Ravindra
  4. Subudhi Rajesh Rao
In the next session Praveena and Prabhat will continue by implementing a method that saves the collection of expenses to a file. Taral and Saurabh Sarupriya will debug the application and get it to work with dates in an India format.

I will announce the next class day and time.

Saturday, February 24, 2007

RunTime Type Information - RTTI

Tomorrow [25-02-2007] we will have a lecture on RTTI or Run Time Type Information. We will learn various aspects of the Java language that help us get and use information of types at run time.
  • Revisit instanceof
  • Understand the class Class
  • Understand introspection in Java
    • Getting details of a class using Class
    • Instantiating a class at runtime without knowing it's type at compile time
    • Invoking methods of classes at runtime
    • Understanding how Java Beans work

Thursday, February 15, 2007

Java generics - topics

We will learn Java generics on Sunday 18-2-2007. The following topics will be covered.
  • Moving from arrays to raw collections to type safe collections
  • Usage of generics in JDK 1.5
  • An example of using generified lists - UsingGenerifiedCollections.java
  • Using objects whose type is a subtype of the generified type
  • Passing a reference of a generified object to another method - UpcastingOfParameterizedTypes.java
  • Wildcards
  • Upper and lower bounding with wildcards
  • Erasure
As I had mentioned earlier, our focus will be to learn how to use libraries that are implemented with generics, and not how to create our own generified libraries.

Sun has a good tutorial to get started.

No class on Friday

We will not have a class on Friday 16-2-2007.

Students for the coding dojo

Sanket, Jiten, and Sumit are welcome to attend the coding dojo. We will start at 3:00 PM. I will be there latest by 2:00 PM, please try and come slightly before 3:00 PM, so we can have the room all set up for the dojo.

I am assuming that all 3 are coming for the dojo. If anyone of you wishes to drop out, please mention so in the comment.

Monday, February 12, 2007

Would any students like to participate in an open dojo

I am conducting an open registration dojo this Saturday at ITLabs (Senapati Bapat Rd) . I may be able to call 2 students to participate (for free) as volunteers,.

I am not sure yet, but whoever is interested can add your name (as a comment here), and I will inform you if it's possible for you guys to join in.

Details (time & venue) can be found here.

Would any students like to participate in an open dojo

I am conducting an open registration dojo this Saturday at ITLabs (Senapati Bapat Rd) . I may be able to call 2 students to participate (for free) as volunteers,.

I am not sure yet, but whoever is interested can add your name (as a comment here), and I will inform you if it's possible for you guys to join in.

Details (time & venue) can be found here.

A little background on dojos

Check my blog for a little background on the coding dojos that we do in class.

Java Generics

In the next class, we will learn Java Generics.

This link has a good introduction to Generics. At the end of the page you will find 2 links to Sun's tutorials which are also well written.

I am trying to have the lecture on a weekday, but am not sure yet. I will confirm the time with the coordinator, if it is possible to take the lecture some day in this week.

Completed Java collections

Hello everyone,

We completed Java collections yesterday. The section was summed up with a dojo to experiment with using Maps and implementing the Comparable Interface for the class that we used as a 'key' in the TreeMap.

The following students participated in the dojo:
  • Jiten
  • Parul
  • Vibhor
  • Saurabh Rai
After completing the dojo, I gave a little take home exercise. But first a little background. We made the Student class implement Comparable because it was to be used as a key in a TreeMap. However, we may not always have the ability to implement an interface, especially in situations when we use classes from 3rd party libraries. But if we want to use objects of these classes as keys in a TreeMap, we have to give the Map some way of comparing a newly inserted key with existing keys (because the keys in a TreeMap are always sorted by invoking the compareTo method or with a Comparator). In such cases, we give the Map a Comparator.

For the exercise, remove the compareTo() method (and the Comparable Interface) from the student class, and give the TreeMap a Comparator object.
(this exercise is for practice and will NOT be graded)

Saturday, February 10, 2007

Class survey

I had posted a survey sometime back to better understand the requirements of students. So far 6 students have answered the questions, and have answered them very well, pointng out things that they find helpfull and providing constructive suggestions about those things that should change:

To summarize:
  • Everyone likes the dojos
  • One student liked the online aspect that we use for our classes
  • Everyone would like me to share the examples that I show in class
  • Some students feel that I should not go too much in detail as it confuses them
Excellent suggestions. I will definitely try to stay away from excessive details. We will continue with dojos. Regarding the examples, I have resisted giving the examples because they may result in copy paste, rather than students trying to write code on their own. In any case I will distribute the examples towards the end of the course.

Thanks to those whi took the time to answer the survey. For those who have not yet answered, I would urge you to take a little time to do so. It does not have to be right now. This survey will remain open till the course is on, so you can answer it whenever you feel you have something to contribute. The survey can be taken multiple time, which means if you missed out something, you can always add it later.

Friday, February 9, 2007

Java Class Schedule

The time table says that we have a Java class on Friday afternoon 3:30 PM.

Now this might actually be my fault. I had scheduled a lecture last Friday and remember that the coordiator had told me that she will schedule my lecture on every Friday. I meant to tell her that the lecture is confirmed only for that Friday, and hence forth we will decide on a ad-hoc basis. BUT I PROBABLY FORGOT TO ACTUALLY SEND THAT MAIL. That's the reason your time table shows the Java lecture on Fridays.

Let me announce it here instead.

Our scheduled lecture is on Sunday 10:00 AM. At times (well most times...) we will need a few more hours in the week, but these slots will be confirmed on an ad-hoc basis with the coordinator.

For all those who showed up for class ... sorry to keep you guys waiting.

--
Parag

Sunday, February 4, 2007

Survey

I signed up for a survey service some time back. I think it is very important to get feedback from participants of my course, so that I can fine tune the course to make it effective for the group.

Since this is a college course, many of you might not be confortable giving me direct feedback, so I have set up an anonymous survey here:

Since we have had a couple of lectures, I think everyone is familiar with my approach to teaching this course. I will appreciate if every student in the class takes a few minutes and fills up the survey. It will help me fine tune the course.

The survey will NOT impact your grades in any manner whatsoever :-)

Thanks

Friday, February 2, 2007

Java Collections

We will start with the Java Collections library on Sunday 4th Feb 2007.


Continuing with IO In Java

We will continue with IO in Java on Friday 2nd Feb. In this lecture we will learn about object serialization and sum up IO with a mini dojo session. As always those who participate will be elligible for extra credits... those who are interested may want to prepare in advance.