Nice TWiki > Dev > NiceConstructors (r1.34 vs. r1.35) TWiki webs:
Dev | Doc | Main | TWiki | Sandbox
Dev . { Changes | Index | Search | Go }
 <<O>>  Difference Topic NiceConstructors (r1.35 - 03 Feb 2004 - DanielBonniot)
Added:
>
>

Isaac, we all agree that implementation details should not be exposed. Again, in Nice with the current proposals (CustomConstructors and PropertySyntax), no implementation details will be exposed to clients, so there is no reason not to use public/package fields.

For instance, for you example you can simply write:

   class A {
      int aa;
   }

   void main(String[] args){ 
      let a1 = new A(aa: 2);
      println( a1.aa );
   }

If later you want to change the implementation of A so that aa is not a field, you will be able to do it, without changing the API of the class.

-- DanielBonniot - 03 Feb 2004


Topic NiceConstructors . { View | Diffs | r1.35 | > | r1.34 | > | r1.33 | More }
Revision r1.34 - 02 Feb 2004 - 23:44 GMT - BrianSmith
Revision r1.35 - 03 Feb 2004 - 09:42 GMT - DanielBonniot
Copyright © 1999-2003 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback.