When ND revised the API, they deprecated methods, classes, and constants
that should no longer be used rather than removing them. 'Deprecated'
simply means that the methods, classes, and constants are marked to indicate
that they shouldn't be used. Eventually, deprecated items are eventually
removed from APIs entirely. This provided some backwards compatibility for
those people who used ND 3 and were upgrading to 4.
Copying and pasting code fragments is always a dangerous process. While it
saves times, it always makes the (mistaken) assumption that the author
verified that it worked in the first place. Always use copied code with
caution.
That said, I'll explain the problem with copying code fragments from ND
documentation. Many of the examples that appear in the ND documentation
were written for ND 3. The API, event model, and many other things went
through major revisions for ND 4. One thing that was omitted from these
revisions was many of the documentation examples! (This sort of problem
also occurs with code examples in the tech notes.)
Unfortunately, for those people trying to use the documentation examples,
this causes all sorts of problems. In some cases, compiling the examples
causes messages about deprecated methods, etc. In other cases, the examples
compile but don't work due to the revised event model.
There's a fairly easy way to get around the problems code fragments that
include deprecated items. Simply look at the Javadocs for the items that
are deprecated and see if ND has included a notation about what should be
used instead. In most cases, they've done that, and the examples are easy
to fix.
Hope that helps.
-- Grace
----- Original Message -----
From: <[EMAIL PROTECTED]>
Newsgroups: netdynamics.public.support.nd4.talk
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 15, 1999 11:53 AM
Subject: [ND] NetDynamics Documentation Series...
> Hello,
> I went into ND docs and found a piece of Java code that seemed usable for
my page. However, when I compiled it, I got
> the following compilation error:
>
> "...\pgStockInputNew uses depreciated API. Recompile with "-depreciation"
for details."
>
> This is not the first time I get this error when I copy some code from the
ND docs. Could anybody tell me what's wrong?
> What is "depreciated API" anyway? By the way, I tried to copy about five
different copies of the Java code for different
> appliactions and neither of them worked. Is this me or maybe I don't add
something necessary that is implied but not said?
>
> I would really appreciate your help.
> Thanks,
> Rimma
> _________________________________________________________________________
>
> For help in using, subscribing, and unsubscribing to the discussion
> forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
> For dire need help, email: [EMAIL PROTECTED]
>
_________________________________________________________________________
For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
For dire need help, email: [EMAIL PROTECTED]