EmmanuelOga / hypergraphdb

Automatically exported from code.google.com/p/hypergraphdb
1 stars 0 forks source link

Better JSON representation in P2P framework #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The current one is a bit ad hoc and hard to customize by users. Perhaps 
refactor it and use the following:

http://code.google.com/p/google-gson/

Original issue reported on code.google.com by borislav...@gmail.com on 21 Oct 2010 at 6:36

GoogleCodeExporter commented 9 years ago
Scratch the use of gson, no need for yet another dependency since most. The 
Java objects serialized to JSON are:

(1) Representation of HGDB API internals (i.e. handles, query conditions etc.)
(2) Atoms
(3) Runtime objects that activities make use of

(1) Are already covered and limited in number.
(2) Should be done using types and the HGDB storage format. This is a more 
correct representation anyway.
(3) Are usually created and accessed as JSON structures and not modeled as Java 
classes. Whoever wants to have arbitrary Java objects passed in between 
activities can always use Gson to serialize them

Besides, there's already a lot of code doing Java introspection and dealing 
with various forms of serialization of Java objects, so better to refactor that 
if need be.

Original comment by borislav...@gmail.com on 16 Feb 2011 at 4:56

GoogleCodeExporter commented 9 years ago
I hope I can plan it. 
I developed a structure notation language from 2006. a super set for any 
structured object string representation, Map and complicate keys directed 
supported.
And maybe employed to make hgdb query language.
I really hope do the plan.

Original comment by saintof...@gmail.com on 11 Mar 2011 at 8:58

GoogleCodeExporter commented 9 years ago
Can you show some examples of your notation? Why would it be better than JSON?

Original comment by borislav...@gmail.com on 11 Mar 2011 at 2:50

GoogleCodeExporter commented 9 years ago
1, The origin project in java.net, about days ago, I check out the mail, 
on.dev.java.net project locked, contacted webmaster, no message still.
Before send the last message,  I tried to search in javalobby, which I 
announced ever,
seem I have need some patient:) in ANT bugs, there is a anton plugin also. OK, 
old is pass.sample as follows:
/** the document can be more than one root, only little symbol 
involved,:;={}'"/\*//*/
project{name: test; default: compile; basedir: .
    property{name: eclipsehome; value: /eclipse install/eclipse/plugins}
            {name: hgdb; value: "http://www.hypergraphdb.org
"}
    target{name: compile; depends: init cc; javac{...}}
          {name: init cc;}
}
eclipseform{
   shell: NO_TRIM:{
      layout: GridLayout:numberColumns: 3;
      button:PUSH:{id: button1; text: hello world}
           {id: button2; text: click me},dummy button without id so not referenced
   }
   style{
     buton1, button2: background: color: red;
   }
}
map: Book.class, Reader.class: {
   {name: HyperGraphDB in action; author: borislav from kobrix.com}:{name: qinxian; location: Center Nation;};
   {name: Master Structured Notation Language; author: Qinxian from CN}: {name: borislav; location: kobrix.com;}
}

Original comment by saintof...@gmail.com on 12 Mar 2011 at 9:11

GoogleCodeExporter commented 9 years ago
2, just as state before, 
complicate keys supported directly.
More, no more typo. 
My work originly named ON, means just Object Notation, inspired from JSON.
discuss with json about quote chars. I guess Doug should live in js world:)
At that moment, Really Simple Data from ajaxion, 
http://ajaxian.com/archives/really-simple-data-yayaml, Dion do same like work, 
especially CSS like.
The simple assignment nest, from OSGi.

In my latest work, from infix string of the notation, employ a variant of 
Shuntingyard arith, almost only 300 lines code get a post fix tree(not binary 
tree) to represent the whole ast tree, which basicly a map-like and arraylist.

So the answer of 2: It should be better than JSON, just like Doug state: I just 
disover it better:)
Oh, NO, I should keep my caution at begin: Sooorry for my bad engish. albiet I 
guess you should get me:)

Original comment by saintof...@gmail.com on 12 Mar 2011 at 9:25