F3 Reflection and Query operators

A friend of mine who works at MIT libraries recently showed me a neat little AJAX data visualization program they developed called Exhibit.

This seemed like a good test case for F3 reflection and for its query operators, so I decided to try to see how hard it would be to do the same kind of thing in F3.

Below is a (partial) F3 equivalent of this Exhibit example.

The above demo also displays the F3 source code.

This is actually a plain Swing program (the F3 Canvas isn't used), but demonstrates the use of HTML templating with F3.

All of the filtering and sorting is actually done in 3 lines of code (take a look at DB.f3 and AttributeValueAssertion.f3).

Some things to note:

  • Attribute is an F3 reflection class analagous to java.lang.reflect.Field
  • Reflective access to the value of an attribute uses the [] operator with an operand of type Attribute, e.g.

       var bar = foo.class.Attributes[Name == 'bar'];
       foo[bar] = 2;
       // The above is analogous to the following Java code
       // Field bar = foo.getClass().getField("bar");
       // bar.set(foo, 2);
    

    is the reflective equivalent of

       foo.bar = 2;
    
  • The F3 order by operator is a binary operator. The left-hand side is any list of objects. The right-hand side is an expression that must return a list of comparable objects. The right-hand expression is evaluated in the context of each element of the left hand side. The current element can be accessed with the . (dot) operator (as in XPath).

    For example,

       [1, 2, 3] order by -.
    

    yields

       [3, 2, 1]
    
Comments:

Very interesting stuff! But where to get F3? regards esser

Posted by esser on December 12, 2006 at 08:22 PM PST #

yeah F3 is great ,being a harcore swing programmer i wish to try F3 myself before i can recommend... when do u plan to release the F3 compiler/interpreter...and what abt the netbeans /eclipse plugins that u spoke off.

Posted by Pavan Kumar Srinivasan on December 12, 2006 at 09:05 PM PST #

Oh Chris, you'll killing us. We're itching to get using F3. F3Pad is tiding me over, but I looking forward to the release. These examples are amazing as well.

Posted by Tyler Weir on December 12, 2006 at 10:04 PM PST #

The ajax page does have one leg up on your swing application, IMO. The various filters available on the left hand side work much better as a stack of boxes (the web version) than a series of tabs (the f3 version), especially in Java 5 with the default look and feel on a windows machine.' Keep up the great work! -Andrew

Posted by Andrew on December 13, 2006 at 02:12 AM PST #

Thank you very much for this useful article. I like it.

Posted by ankara evden eve on September 11, 2008 at 07:58 PM PDT #

Thank you very much for this useful article. I like it.

Posted by ankara nakliyat on September 11, 2008 at 07:58 PM PDT #

Thank you very much for this useful article.

Posted by tuzcuoğlu on September 11, 2008 at 07:59 PM PDT #

Thank you very much for this useful article. I like it.

Posted by abiyeler on September 11, 2008 at 07:59 PM PDT #

Thank you very much for this useful article. I like it.

Posted by evden eve nakliyat on September 11, 2008 at 08:00 PM PDT #

Thank you very much for this useful article. I like it.

Posted by web tasarımı on September 11, 2008 at 08:00 PM PDT #

thenks

Posted by web tasarımı on November 18, 2008 at 03:53 AM PST #

thanks you. good sharing.
http://www.estetikinternational.com

Posted by Estetik on April 07, 2009 at 05:50 PM PDT #

Equivalent FUJITSU FPCBP160 Laptop Battery
# Net Weight : 311.4g
# Battery Chemistry : Li-ion
# Battery Voltage : 10.8V
# Battery Capacity : 4600mAh
# Battery Cell Origin: Japan
# Battery Color : Dark Grey
Website :3w.my-batteries Dot Net

Posted by 724depot on May 13, 2009 at 12:29 AM PDT #

b2cpowershop.com is here to help you obtain the best quality lowest priced electronic accessories. We specialize in those hard to find accessories and specialty items. This is why we have a huge selection that boasts more than 10,000 different kinds of Consumer Electronics and more. With our great selection you are sure to find everything you need. However, if you can not find what you are looking for give us a call or email we would love to find it for you.

Posted by b2cpowershop.com on May 13, 2009 at 12:30 AM PDT #

As the limitation of eBay, such as only shipped to some countries, no combined shipping offer, can not meet all your needs. However, successful logging on upowerbiz.com can solve all the problems. We hope that more worldwide business partners can join us with our favorable price and excellent service.

Posted by upowerbiz.com on May 13, 2009 at 12:31 AM PDT #

possibility of sharing and social solidarity at a level just fine thank you

Posted by Buz on August 22, 2010 at 09:32 PM PDT #

Simple and Nice example !

Posted by شات on December 15, 2010 at 03:44 AM PST #

York test yaptırın ve size nelerin iyi gelip nelerin dokunduğunu parmanızın ucundan alınacak bir damla kan ile hemen öğrenin böylece çok daha sağlıklı olmanız önünde h,iç bir engel kalmamamkla beraber çok daha dengeli beslenebilirsiniz <<p><a href="http://www.check-up.gen.tr">Check up</a></p>

Posted by york test on December 28, 2010 at 09:11 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

user12610627

Search

Archives
« July 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  
       
Today