Explaining that the API and its impl shall be kept in one package.
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 22 Sep 2008 18:19:25 +0200
changeset 381bafaac7336
parent 2 dbe3092e851d
child 4 15a0ae280eb4
Explaining that the API and its impl shall be kept in one package.
Also stressing that the Convertor shall be "pre-made" in the API, no subclassing needed to create its implementation.
currency/src/org/apidesign/apifest08/currency/Convertor.java
currency/test/org/apidesign/apifest08/test/Task1Test.java
     1.1 --- a/currency/src/org/apidesign/apifest08/currency/Convertor.java	Sat Sep 20 18:38:55 2008 +0200
     1.2 +++ b/currency/src/org/apidesign/apifest08/currency/Convertor.java	Mon Sep 22 18:19:25 2008 +0200
     1.3 @@ -1,6 +1,11 @@
     1.4  package org.apidesign.apifest08.currency;
     1.5  
     1.6 -/**
     1.7 +/** This is the skeleton class for your API. You need to make it public, so
     1.8 + * it is accessible to your client code (currently in Task1Test.java) file.
     1.9 + * <p>
    1.10 + * Feel free to create additional classes or rename this one, just keep all
    1.11 + * the API and its implementation in this package. Do not spread it outside
    1.12 + * to other packages.
    1.13   */
    1.14  class Convertor {
    1.15  }
     2.1 --- a/currency/test/org/apidesign/apifest08/test/Task1Test.java	Sat Sep 20 18:38:55 2008 +0200
     2.2 +++ b/currency/test/org/apidesign/apifest08/test/Task1Test.java	Mon Sep 22 18:19:25 2008 +0200
     2.3 @@ -4,13 +4,12 @@
     2.4  import org.apidesign.apifest08.currency.Convertor;
     2.5  
     2.6  /** Finish the Convertor API, and then write bodies of methods inside
     2.7 - * of this class to match the given tasks.
     2.8 + * of this class to match the given tasks. To fullfil your task, use the
     2.9 + * API define in the <code>org.apidesign.apifest08.currency</code> package.
    2.10 + * Do not you reflection, or other hacks as your code
    2.11 + * shall run without any runtime permissions.
    2.12   */
    2.13  public class Task1Test extends TestCase {
    2.14 -    static {
    2.15 -        // your code shall run without any permissions
    2.16 -    }
    2.17 -    
    2.18      public Task1Test(String testName) {
    2.19          super(testName);
    2.20      }
    2.21 @@ -26,6 +25,9 @@
    2.22      /** Create convertor that understands two currencies, CZK and
    2.23       *  USD. Make 1 USD == 17 CZK.
    2.24       *
    2.25 +     * Creation of the convertor shall not require subclassing of any class
    2.26 +     * or interface on the client side.
    2.27 +     *
    2.28       * @return prepared convertor ready for converting USD to CZK and CZK to USD
    2.29       */
    2.30      public static Convertor createCZKtoUSD() {
    2.31 @@ -35,6 +37,9 @@
    2.32      /** Create convertor that understands two currencies, CZK and
    2.33       *  SKK. Make 100 SKK == 80 CZK.
    2.34       *
    2.35 +     * Creation of the convertor shall not require subclassing of any class
    2.36 +     * or interface on the client side.
    2.37 +     * 
    2.38       * @return prepared convertor ready for converting SKK to CZK and CZK to SKK
    2.39       */
    2.40      public static Convertor createSKKtoCZK() {