Hi 
These are the first questions related to the (excellent) article from DeveloperWorks 
by Bruce Snyder: "Learn the basics of object-relational binding using Castor", august 
2002:
http://www-106.ibm.com/developerworks/java/library/j-castor/

This article helped me a lot getting started withCastor-JDO, but it still leaves som 
open questions. Here they come...

Q#1:
In Listing 1. Product.java you find these statements:

      public void addCategory( Category category )
      {
        if ( _categories.contains( category ) ) {
          _categories.addElement( category ); category.addProduct( this );
        }
      }

(Remark: there's a missing NOT-operator in the "if"--ought to be corrected).

Question is: why this check for existence of "category" in "_categories"?
It's obviously to avoid adding an object twice, but is it because Castor would do this 
in some situations?
Or because a programmer could (by accident) use both addCategory and addProduct (in 
the Category class)?  

Q#2:
What's the reason for using underscores as the first character in member variables?

Thanx for any help. 

/Keld

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to