Thursday, November 15, 2007

29.MyIsern-1.3-review

1. Installation Review: Myisern team Red

I was able to download the installation file through their google project hosting site but none of them actually had a blog page that easily pointed to it. I can't really say much because my team didn't do the same since it wasn't assigned to us but it would have been helpful. After downloading and unzipping the file I realized that there really isn't any way to start this program without having to use ant to deploy it. But there is always the option of uploading the war file to your tomcat manager. I decided to just run it from ant and then uses the tomcat manager to access the website. There didn't seem to be much a guide either but there was a README file that contained what the site could and could not do. Lastly I did run ant -f verify.build.xml to run all the tests and it looks like all the tests passed. Emma showed:

Class 60%
method 25%
block 29%
line 26%

2. Code format and conventions review:

Right off the bat there were many variables that weren't being read according to Eclipse. Otherwise the code and the javadocs actually seem neat and tidy. There are comments in place of missing code and it is all easy to read. Everything seems to be up to standards and coding is modular which helps readability.

3. Test case review:

So far the only tests that exists where 4 tests that ensure that the three adding pages and the main menu page showed up on the test host. There was also a test for the model that made sure that the instance of the model followed the singleton method. Other than this there were no other tests.

As for breaking the buggah, the page had many links that didn't work, such as all the editing pages as well as a few buttons that didn't do what it said it would do. The print buttons for Organization and collaboration didn't work. In the read me file it did state that the editing functions still weren't developed so I can see why those pages didn't work but I couldn't see why the print button didn't work.

On the other hand, the adding functions did work and I could see it added after brought up the display page. Otherwise I had no idea if I added the item or not.

4. User Interface review:

As for the UI, it was texted based with no graphics. It was a bit hairy to read and a bit confusing but this is still a work in progress. I could see it going a long way with a simple UI using css or even basic html. As for screen real estate, being text based it used screen real estate very well. Sizing the screen to just about any respectable size still still held the interface clearly. Lastly, there are many improvements that can be made here aside from the basic html/css layout design. Everything seems to be aligned to the top left which is great for resizing the screen but horrible at full screen.

5. Summary and Lessons Learned:

The things that I've learned is that looking back on my own program I can see how a simpler approach might actually be better then complicated css/html code thrown everywhere. It might not be the prettiest of all the projects but it does get some of the jobs done with mild discomfort. I also realized how important it is to actually give feedback to the user after they have accomplish a task such as editing or adding a researcher. Without letting them know that the action was completed, it just adds more steps to actually getting through the page.

Sunday, November 4, 2007

26.StackStripesExtension

At first, I thought that this was going to be a horrible assignment that would take me all week to do and that I would have to slave over it for hours. But in actuality it was pretty simple. It took a while to get used to but that could be said for just about any new piece of software. So, of course, I had the basic hiccups when it came to installing tomcat and stripes. Tomcat was a bit harder since we had to edit the conf directory files. But all in all it was pretty easy to get going.

I think the hardest thing was just getting used to using tomcat, making sure that it was running, restarting it after Emma, restarting tomcat every time we made changes and such. The actual code wasn’t very hard at all once you grasped the theory behind it. It just took me a while to grasp that theory. It wasn’t as hard as our previous assignments where I had to trace over all the code but it was a bit challenging. Overall, I’m happy to say that I’ve completed all the tasks with enough time to get some sleep!


here's the link to my program...

http://www2.hawaii.edu/~eykim/stackstripes-1.0.1106.zip

25.WebAppQuestions

1.) Explain in your own words the meaning of the web "request-response cycle".

The request-response cycle is basically the cycle where a user looks at a page, clicks on some object which then tells the browser to send a HTTP request to the server. The server in turn takes the request, works it out and sends back a response. (Wash, Rinse, Repeat.)

2.) Explain how servlets facilitate processing of the request-response cycle.

Servlets are basically java classes that reside on the server. They process the information sent by the user and returns data accordingly. This allows for dynamic web pages.

3.) How do you login to the Tomcat Manager?

First, tomcat must be running. Then go to the localhost manager page on your web browser or through ant. (http://localhost:8080/manager/list). Enter the username and password that was set in the tomcat conf directory.

4.) What is the Tomcat Manager used for in the StackStripes application?

The Tomcat Manager is used to deploy the StackStripes Application on to tomcat. Since tomcat is password protected, we use the manager to log in and deploy or undeploy the application.

5.) What is the directory and file layout of an installed web application like StackStripes? (This is NOT the same as the directory and file layout of the StackStripes distribution!)

Inside StackStripes is…


Stackstripes\index.jsp //homepage
Stackstripes\META-INF //meta info
Stackstripes\WEB-INF //web info


Stackstripes\WEB-INF\web.xml // xml containing configuration info


Stackstripes\WEB-INF\classes //classes
Stackstripes\WEB-INF\classes\commons-logging.properites //config info
Stackstripes\WEB-INF\classes\log4j.properites //log4j info
Stackstripes\WEB-INF\classes\StripesResources.properites //stripes resources info
Stackstripes\WEB-INF\classes\edu/ // all the things I’ve written

6.) How do you build a war directory structure in Ant? Where is this accomplished in the StackStripes application?

The stack Stripes application builds the war directory through ant in the build.xml file. To build the war directory you need the location of the directory to be created, the web xml file with all the configurations, and all the side info like classes, libraries, and file sets.

The build.xml file should set all these attributes accordingly.

7.) How do you install a war directory in a running Tomcat server? What information does the Ant task need to accomplish this?

Installing a war directory in a running Tomcat server is as simple as just copying the war directory into the webapps folder in Tomcat. The webapps directory is found in the home directory for CATALINA. This can also be accomplished in ant but just setting the destination directory to the webapps folder.

8.) What is the "Model2" architecture? What are its advantages?

The model2 or MVC (model – view – controller) architecture is a architecture pattern that consist of a large amount of data to the user i.e. the model and represents in it a view i.e. interface so that the changes do not affect the data. This is done through an intermediate called the controller. The advantage is it solves the problem of decoupling data access from user interaction.

9.) What are JSP pages? How are they related to servlets?

JSP pages are Java Server Pages and are basically html pages with JavaScript embedded. The JavaScript is compiled into a servlet, and the servlet handles, processes, and return data to the html page where the script is located. This allows for dynamic html pages.

10.) Why is there a delay when retrieving a JSP page for the first time? Where is the Java code for that page stored?

There is a delay when retrieving a JSP page for the first time because the server needs to compile the JSP pages into a servlet. Afterwards the servlet is held within memory on the server for as long as needed. The Java code for that page is stored within the page itself.

11.) What are JSTL tags? Why are they useful? What is an example JSTL tag from the StackStripes system?

JSTL tags are JSP Standard Tag Library tags are simply tags that surround core functionality commonly needed to make dynamic html pages. They are useful because they are in XML standard format and work well in html. This avoids the need to write the java code into the html making the html code easy to read and edit by someone that does not know Java.

Example:

${element}

12.) What are Stripes tags? Why are they useful? What is an example Stripes tag from the StackStripes system?

Stripes tags are basically html tags that allow the linking of button and fields on a webpage to their appropriate java classes. They are useful because they link a button or such to the respective get or set function in java which saves a lot of code.

Example:

13.) What is HttpUnit? How is it different from JUnit? Why is it useful? What is an example use of HttpUnit from the StackStripes system?

HttpUnit is a java class that allows a programmer to access web sites without a browser. It is useful for testing any Java code that deals with web pages because it can go beyond JUnit because JUnit will only test java code running on the client.

Example:

WebForm pushForm = response.getFormWithID(PushForm);

WebRequest pushRequest = pushForm.getRequest();

pushRequest.setParameter(numToPush, "1");

response = conversation.getResponse(pushRequest);


14.) What needed to be changed in order to implement the Double It button? What didn't need to be changed? What did you learn about the MVC design pattern from this exercise?

All that you needed to do was to create a DoubleIt method for the Action bean and a double it button in the index.jsp file. Nothing else was needed. I actually didn’t learn too much about the MVC design pattern through this other than the button and the method needs to have a relevant link.

15.) What are the equivalence classes that need to be tested for the Double It button?

The equivalence classes would be to test on an empty stack, a stack with one or more object, and a stack with a ridiculously large amount of objects.

16.) Provide two screen images of your new StackStripes application with the Double It button, one showing the page before and one showing the page after hitting the "Double It" button.









17.) What is the singleton design pattern? What is an example of its use in StackStripes? Why is it needed?

The singleton design pattern is a pattern that restricts the instantiation of a class to just one object. This is needed because we want all users to interact with just one instantiation of the stack class. This way all the users will have and work on the same information even through multiple “views” across the internet.

Example:

private static StackModel theInstance = new StackModel();
private ClearStack stack;
private StackModel() {
this.stack = new ClearStack();
}

18.) Some of the StackStripes tests exercise code on the "server side", while others exercise code on the "client" side. Which test classes exercise code on the "server", and which exercise code on the "client"? How does Emma deal with this to create appropriate coverage data?

The file TestStackModel.java exercises test cases on the client side while TestStackActionBean.java exercises test cases on the server side. Emma deals with this to create appropriate coverage data by shutting down Tomcat.

19.) Running 'ant -f junit.build.xml' results in the following target invocations: tomcat.check, tomcat.undeploy, compile, war, tomcat.deploy, junit.tool, junit.report, junit. Explain what each of these targets do.

Tomcat.check

This checks to see if tomcat is up and running.

Tomcat.undeploy

This undeploy the application from tomcat.

Compile

Complies the code, what else?

War

This builds the war directory.

Tomcat.deploy

This deploys the application on Tomcat.

Junit.tool

This runs the JUnit test on the given code.

Junit.report

Reports any errors found in the JUnit tests.

JUnit

This runs the Junit.tool and Junit.report tasks. It will display errors if found.