Wednesday, September 24, 2008

11.Stack

____________________________________________________
GOAL:

To be able to get familiarize ourselves with the Ant build
system, open source automated quality assurance tools like
FindBugs, PMD, an
d CheckStyle, and build system structure.


TASK 1:


First, installing all the tools namely Ant, JUnit, PMD, FindBugs, and Checkstyle was easy . However, we have to set up all the Environment variables which I forgot to do after installing those tools. So when me and my partner was starting to do the Ant Lab in the class we had to actually set up all the paths for those tools and that took a while. After everything was set up invoking all the targets was fine except when I run the
"ant -f junit.build.xml" it failed because and it's saying something about the testing of the TestStack.java. So I run the TestStack.java on Eclipse and the test failed because the the top() method in the Stack is trying
access the first one that is push on to the stack instead of the one that is on top
of the stack. And the other one is trying to pop something that has been already remove from the stack. So I fixed that one by modifying the Stack.java class and TestStack.java class.


  • ant clean compile
  • ant -f checkstyle.build.xml
  • ant -f dist.build.xml
  • ant -f findbugs.build.xml
  • ant -f javadoc.build.xml
  • ant -f junit.build.xml
  • ant -f pmd.build.xml
  • ant -f verify.build.xml

Here is the revised build stack file:

http://www2.hawaii.edu/~flestado/stack-flestado.zip


Sunday, September 14, 2008

CodeReview

GOAL:

To be able to identify any violations of
the Java coding standards and documentation.

Reviewer: Mari-Lee Flestado
Reviewee: Jeho Jung

File
Lines
Violation Comments
MyRuler.java
1, 2,3, *
EJS-5
Code is indented 4 spaces instead of 2 spaces
MyRuler.java
1 ,3
EJS-SE-JAVA-2
Code used the wildcard "*" in import statement
MyRuler.java

121,147
EJS-22
Code did not use lowercase for the first word for method names.
MyRuler.java
7, 156
EJS-46


Code did not use a fixed ordering for Javadoc tags.



The logic of the code itself performs the task in a very efficient 
manner. I did run the code also and what I really like about it is 
how the knights captured the castle really fast and when the 
knights captured the opponent's castle then it can create more
knights and peasants. That was one of the strategy that I tried 
to implement in my own code but it didn't really work. 
However, the only thing that I've notice was the lack of good 
application of Java coding documentations which I have listed
above. But other than that he implemented a very interesting 
strategy in his program.


Monday, September 8, 2008

05.CodeRuler

________________________________________
LESSON LEARNED FROM CODE RULER:

Time dedication is always been big part of programming. But in this project I think that was my biggest challenge. Because of time conflict with my former partner and my busy work schedule, communication in a timely manner was really hard. Unfortunately, he finally found someone else to do the project with .

The strategy that I came up with is :
  • to release the peasants in different directions to claim unoccupied lands and opponent's lands
  • when the opponent's peasants, knights and castles are more than ours we create more peasants, knights and castles.
  • when there are peasants or knights on our way we capture then and finally capture the opponent's castle.

Source code and javadoc link:
www2.hawaii.edu/~flestado

RESULT:
_________________________
marilee vs. migrate ruler
_________________________
438 - 94
408 - 121
330 - 118
_________________________
marilee vs. gang up ruler
_________________________
66 - 499
18 - 346
41 - 536
_________________________
marilee vs. split up ruler
_________________________
17 - 522
8 - 602
27 - 527





Among the three teams the hardest to compete with were the 2 groups(gang up and split up rulers), as you can see I got defeated pretty bad. I know I could have done better if I put more time in doing it. I think the reason why the 2 teams defeated me really bad was because I didn't develop a better strategy in attacking the enemy and protecting my castle, knights and peasants at the same time.

What I have learned about eclipse is remembering some of the features that I haven't use for a while. But comparing Eclipse to other IDE's out there, I would say that Eclipse has the best hands-on resources to help a lot of programmers .






Monday, September 1, 2008

OSS Experience

  • OVERVIEW

The package Openbravo POS is a point of sale application that is designed for touch screen and it is also a program that allows user to be able to assign customers to receipts using the customer's loyalty card, create invoices, track the account of the customer, payments, customer's report execution, etc.












The Openbravo POS website (http://sourceforge.net/forum/forum.php?forum_id=861610) has the description of the package, introduction, download links, etc.

Finally, the main objective of this particular program or package is to provide convenience for multiusers to do products entry forms, charts, and reports.

_______________________________________________________
  • Prime Directive #1: The system successfully accomplishes a useful task.
The Openbravo POS program is very interesting. I work as a sales associate and our company (Food Pantry) was of one the first company to use Celerant RMS, which almost has the same features as the Openbravo POS. I tried some of the features of Openbravo POS such as processing transactions, edit customer's information, inventory management, back office and more.

Therefore, I would say that Prime Directive #1 is satisfied.

_______________________________________________________
  • Prime Directive #2: An external user can successfully install and use the system.
I installed Openbravo POS 2.20 with no hassle and after installing it I opened the program.

















In the Login Panel above, I logged in as a manager (choose title: manager, employee, guest, administrator, etc.) and you get this panel below.
















When you log in as a manager you are able to access the stock (inventory, warehouse, catalog), customer's information, sales reports and graphs, etc.

In contrast, logging in as an employee you can only access to certain features such processing transactions, editing sales, and password change.













In that case, Prime Directive #2 is satisfied.

_______________________________________________________
  • Prime Directive #2: An external developer can successfully understand and enhance the system.
Openbravo POS 2.20 allows a developer to create rules because this system has the scripting capabilities. The scripting capabilities of this system offers a simple scripting language (JavaScript) that is easy to learn, object model, security, etc.

___________________________________________________________________

The Object Model

There are five objects passed to the scripts: ticket that contains the data of the current ticket, taxes that contains the list of available taxes record, place that in restaurant mode contains the table object, in other modes contains null, user that contains the user object and sales that contains utility methods of the sales panel.

  • ticket. Contains all the information related to the ticket is an object of type TicketInfo
  • place. Contains the table in restaurant mode. Is an object of type String.
  • taxes. Contains a list of all the taxes. Is a map that contains objects of type TaxInfo.
  • taxeslogic. Contains a list of methods that calculates the taxes lines of a current receipt. Is an object of type TaxesLogic.
  • user. Contains the user that is currently logged in the application. Is an object of type AppUser.
  • sales. Contains utility methods of the sales panel. Is an object of class ScriptObject.

Utility methods

The sales object available in scripts button and events contains a list of utility methods of the sales panel.

  • getInputValue(). Returns the value typed in the sales panel using the on screen keyboard.
  • getSelectedIndex(). Returns the index of the selected receipt line in the sales panel. If the receipt has no lines returs -1.
  • setSelectedIndex(int i). Sets the index of the selected receipt line in the sales panel.
  • printReport(String resourcefile). Prints a report using the current receipt using the included Jasper Reports engine. This command is useful if you want to print elaborated invoices from the sales panel.
  • printTicket(String resourcename). Prints a receipt in the receipt printer.
  • evalScript(String code, ScriptArg... args). Calls another script.

Attributes

Receipts, receipt lines and products have a list of properties called attributes. These attributes can be used for any purpose the developer needs. When adding a new receipt line Openbravo POS copies the attributes of the product to the line, Openbravo POS does not manage in any other way the content and values of these attributes, and is the developer of script buttons and events the responsible of managing its values.

These attributes are stored in the database and can be edited in the products panel as an XML text file. This is an example of a product attributes record:


http://java.sun.com/dtd/properties.dtd">
    Asian salad attributes
    Only available in spring.
    Letucce, and other vegetables

                                -- Openbravo POS Scripting Tutorial
http://wiki.openbravo.com/wiki/Openbravo_POS_Scripting_Tutorial#Examples


______________________________________________________________________________
CONCLUSION

This Openbravo POS system basically fulfilled its main objective and it is very user friendly, flexible, and convenient, as well. Finally, the package is really easy to install and run and external developers can easily understand and enhance the system by using its scripting capabilities and other features.