Wednesday, October 24, 2007

JUnit Testing

As promise last week , Mr Mok would shows us more hands on example on JUnit testing. In today lesson , Mr Mok had show us where, how to install and run the JUnit program to test on our java coding. During our 2nd lessons onwards , we were told that before coding out a system , we should come out with our test classes and run it in JUnit testing. This is to ensure that the test classes are workable and there is no error occurred when the developer wants to do the next coding phase.

We had downloaded the JUnit program in our school computer. However , due to versioning (our computers in our lab are not installed with JDK 1.6) , we are unable to test our JUnit program. It was a bit disappointed but my laptop has saved me.... i had reinstalled the Junit program in my laptop and had worked from there.

By downloading to configuring the JUnit, had being a difficult process for a beginner. I think that once we get hold of the program, it will be easier for us to use it when our assignment two was assigned. We are able test our test classes using JUnit Testing.

Before the lesson end , our group had decided the location and time for our group meeting on our assignemnt 2. I hope that in this discussion , we are able to look into the requirement specification , download netbeans to our system , create grapic user interface for the system as well as coding.

3rd Presentation: Bridge Pattern

The last presentation of CSI3303.
6 of us had presented our last design pattern. In the presentation , I had briefly introduce what is bridge pattern and how it is useful to us?

Bridge pattern is a design pattern used in software engineering .The purpose is to divide a complex component into two separate but related inheritance hierarchies. It able to make it easier to change either aspect of the component.

For example , if a user wanted to develop a ToDoList for the Personal Information Manage, a system should be flexible, able to modify and ability to choose.Thus to support this software, it is better to separe the ToDoList representation from its underlying implementation.

Benefits of this approach
Benefits of this approach is apparent when developer add capabilities to the basic behavior.
To add characters or numbering in subclass List.
To support features like grouping items sequentially : extend ListImpl.

In this presentation , one of our classmates had talk about the proxy design pattern. In proxy design pattern , it may be useful if the user have a remote object in a far away area and wants to have access to it. The proxy pattern creates a object locally which represent the remote object . Any communication with the remote object can now talk directly with the local object.There are several type of proxy deisng patterns. They are: virtual proxy, remote proxy, protective proxy and smart proxy.

I had also learn a brief idea on how the JUnit testing works as will as other 3 design patterns. Mr Mok will show us more hands on example and how to run a JUnit testing in the next coming lesson.

Tuesday, October 23, 2007

2nd Round of My Presentation

This week is my second presentation of java design pattern. I presented the template design pattern during the lesson. I had heard that the template design pattern is one of the easiest to understand of all the 24 types of design patterns that are taught in the syllabus. I am the third to present. I had given a short descriptions on the java template design pattern , follow by where does it implement, how does it benefits to the developer , the structure of the template design pattern and last but not least the coding as an example of the java design pattern.

By using Template design pattern , it helps to refactor common behaviour to simplified code however , if a beginner who is unfamiliar with coding and have little knowledge on Java programming , he might be having difficulties in writing and reading the code. Template design pattern is defined s the program skeleton of an algorithm in an operation. Template Methods lets subclasses redefine certain steps of an algorithm without changing the algorithm structure. Thus , the template methods helps to manage hte larger picture of task semantics , and more refined implementation details of selection and sequence of methods.

In total, there are 6 of us presented the design pattern. We are asked to grade our peer during the presentation. Some of the pattern i still having trouble to figure out , i will find a day to read up the methods and try it on myself.

Last but not least , Mr Mok had brought up the structure and the requirement of assignement 2. He had briefly tell us the scope and the java design methods that we are supose to use in our assignement 2. I had found my group members who are Han lin thet and John. I hope for the coming assignment , we can work and excel in a group. I am looking forward in this coming project ... learning journey of java coding is going to begin in my next phase of life..hehe...