Talk:Blogs:JaroslavTulach:Practical Design:FixModifiers
From APIDesign
Comments on Blogs:JaroslavTulach:Practical Design:FixModifiers <comments />
Ezward said ...
Thanks for your comment. The rules for function arguments would be slightly different than for method visibility.
As concern the check for null, I know JSR 305: Annotations for Software Defect Detection is about to provide ways to annotate parameters with @NotNull. NetBeans project is already using it, as I noted in TheYearOfAnnotations2009.
As the immutability goes: Java does not have the C++ const keyword which de-facto switches between two states each object can have (mutable and immutable). To achieve this in Java one needs to split the concerns into two classes. One serving as mutable handle to internal data, one as read-only facade to it.
This is interesting topic. I slightly touched it in the book's Chapter 7, Give the Creator of an Object More Rights, but I guess I shall expand the topic on the website once. Thanks for inspiration.
--JaroslavTulach 05:13, 26 March 2009 (UTC)
Somo said ...
If we are at "clarity", how about using a background/foreground color combination that makes your text easier to read? (my eyes hurt already after trying to read just a few seconds :) ).
--Somo 11:42, 26 March 2009 (CET)
Good news for Somo and others who asked for Black on White colors for this website. Now you can have them: Find Black/White symbol in the left navigation bar to make temporary switch or log in and choose your preferred skin in your preferences.
--JaroslavTulach 11:24, 4 April 2009 (UTC)
How about access modifiers for function arguments. Java is a pass-by-reference language. Therefore, anything I pass in may be modified by function I am calling. Also, the reference may be null. I would like a modifier that specifies that an argument may not be null. I would also like a modifier that specifies that an argument is read-only: it may not be modified.
--Ezward 02:05, 26 March 2009 (CET)