> - Properties in a generated "enum" for each class for clean introspection.
+1. My biggest problem with Java is how it's not possible to reference a property. That means any kind of binding layer, EL, JPQL, beans binding etc. has to resort to strings and late binding and that's just unacceptable. /Casper On Dec 22, 12:57 pm, "Frederic Simon" <[email protected]> wrote: > WOW, great.I have also an internal branch (never managed to finalize it :) > in kijaro to extends Remi Forax properties with "Property Types" in Java. > It looked quite good, I had: > - Immutable property with lazy init and no synchronize; > - Property managed by DI container (WebBeans) for state isolation; > - Properties in a generated "enum" for each class for clean introspection. > > I cannot wait to see how to integrate this kind of "properties power" in > Fan. > Please keep us updated... > > > > On Mon, Dec 22, 2008 at 11:54 AM, mikaelgrev <[email protected]> wrote: > > > Fan looks really really promising to me. > > > I haven't looked at it for a while now but I remember that I was all > > giggly after your article about it a while ago Stephen. > > > I'm going to head over to the Fan site now and see if the properties > > implementation is powerful enough for me. I really want extensible > > property types. I have about 10-20 property types in an application > > and could not live with a simple get/set replacement, even if it is > > observable. List/Map property types, lazy init and the ability to tag > > it somehow (e.g. tag a property with "repaint") is key to me. It is > > also important that a subclass can intercept and override a property > > (this is lacking in my implementation right now since Java doesn't > > support it). But I'm rather picky when it comes to properties, I > > know. :) > > > Cheers, > > Mikael Grev > > > On Dec 22, 1:24 am, JodaStephen <[email protected]> wrote: > > > Fan is an interesting language because it doesn't try to do too much - > > > it's pragmatic, and I'm all for pragmatism. > > > > On types for example, there are degrees of static typing. Scala has > > > stronger static typing than Java, and sometimes (when linked to other > > > features) that will cause you to spend time deciphering the code or > > > keeping the compiler happy. Fan has slightly weaker static typing than > > > Java. You can use the -> operator to effectively do reflection/duck- > > > typing. And it has automatic casts, so you hardly ever write casts > > > yourself. Its a key approach of Fan to have a simple type system. > > > > One side effect of a simple type system is a simple compiler. The Fan > > > compiler is incredibly simple IMO. I've coded in javac, and its a > > > nightmare trying to work out what all the different parts do, and I > > > never got the hang of generics in javac. Fan's compiler is just a few > > > classes, perhaps 20% of the code, probably less. A smaller compiler is > > > a sign of less rules for the end developer to learn. > > > > Another example, simple field/method naming. You can't have a field > > > (property) and a method with the same name, and you can't have two > > > methods with the same name (no method overloading - although default > > > parameters provide some of this). The impact of this simple rule is > > > that any field/method can be referenced by a single name with no > > > confusion, resulting in much simpler reflection and class structure. > > > > In addition, there is modularity (pods) built in from day one, which > > > will make a huge difference down the road. > > > > Comparing Fan to Scala is a little unfair at the moment though. Scala > > > is about 2-3 years ahead in adoption. Fan is still very young. It just > > > happens that Fan is very much closer to my view of Java NG than Scala > > > (Java NG to me is Java with warts removed and missing features added). > > > > BTW, Fan isn't perfect yet, and there are some syntax discussions yet > > > to be completed, but for me its looking really exciting. > > > > Stephen > > > > On Dec 19, 3:32 am, "[email protected]" <[email protected]> > > > wrote: > > > > > I've been reading up on Fan a bit (http://www.fandev.org/). Looks > > > > very interesting, has some features the Java world is sorely missing > > > > and few talk about: > > > > > 1) scripting - you can write Fan scripts in stead of the java way > > > > which is to write everything twice - as a batch file and a unix shell > > > > script. Or write heinous XML files (Ant/Maven) > > > > 2) interactive shell - all the dynamic languages have this (groovy, > > > > ruby, python). Hugely useful. Most java-ists don't "get" it because > > > > they are stuck in "compile, deploy, test" land and haven't ever seen > > > > this technique. It's a huge time saver in my experience using Ruby's > > > > IRB and Groovysh. > > > > 3) dynamic methods via the -> operator. Fan doesn't give up static > > > > typing, but it still has the power of dynamic methods via the -> > > > > operator. This makes things like Active Record (http:// > > > > en.wikipedia.org/wiki/Active_record_pattern) and XML Builder (http:// > > > > groovy.codehaus.org/GroovyMarkup) possible. > > > > Seems like the best of both worlds to me > > > > 4) simple literal array/list and hash syntax, much like Groovy/Ruby > > > > a = [0, 1, 2] // List literal > > > > [1:"one", 2:"two"] // Map literal > > > > 5) sane string handling (no escape char BS, multi-line strings, String > > > > interpolation ("x is $x, in hex $x.toHex, and x+8 is ${x+8}") much > > > > like Groovy > > > > 6) no primitives > > > > 7) Mixins > > > > > And the stuff that people talk about all the time: > > > > 8) ability to make a class immutable > > > > 9) Closures (what language doesn't have closures these days? oh, > > > > wait) > > > > 10) runs on JVM (of course) > > > > 11) properties > > > > 12) easy APIs (e.g. no streams for File, very powerful closure based > > > > collections like Groovy/Ruby), nice calendar API > > > > 13) message based concurrency > > > > 14) operator overloading > > > > > What doesn't it have that it should have? > > > > > * Reg ex literals (so you can write a switch /regexp/ > > > > * ||= null check operator if (a||= 5) if a == null then a = 5) > > > > * multiple return values from a method (or tuples) > > > > * default values in method signatures > > > > * execute command line commands ( I don't think they have it) > > > > * unless / if suffix syntax like ruby > > --http://www.jfrog.org/http://freddy33.blogspot.com/http://nothingisinfinite.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "The Java Posse" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaposse?hl=en -~----------~----~----~----~------~----~------~--~---
