Chuck: I know you weren't convinced that it is needed but it could be a good way to enforce that a type contains only static members, as using "shared" in the umbrella context allows having instance members within the type.
- Code: Select all
class StringUtil // just for e.g. purposes. Like Chuck pointed out "extends Type" makes most utility classes obsolete
shared
def foo(str as String)
pass
# generates
public class StringUtil : Object {
public StringUtil() ...
public static void Foo...
}
# but
class StringUtil is shared # define a truly static class
def foo(str as String) ..
# generates
public class StringUtil : Object {
private StringUtil() ...
public static void Foo(String str) ...
}