Coder Social home page Coder Social logo

ndjson's People

Contributors

nathanday avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

ndjson's Issues

Server Request/Response level of abstraction

A higher level of abstraction can be created to handle server request/responses. Could define a NDJSONRequest and a NDJSONMutableRequest. Programmers could either manipulate NDJSONMutableRequest's or subclass NDJSONRequest. Need to create a way for uses to simply define how the response should be handle, (which keys are handled by what kind of NDJSON parsing method.

Added support for UTF-16 and UTF-32

Though they are not used much, UTF-16 and UTF-32 are legal text encodings for JSON and added support for these shouldn't be two difficult.

JSON can only be parsed into tree type graphs

Since JSON itself is a tree currently only tree can be generated, it would be good to have some mechanism for recognising multiple references to to the some entity in the tree and remove that duplication, for example in JSON second reference to the same entity can represent as a simple id to the fully fleshed out original version.

Change the core parsing mechanism

Have a parseBytes method, which maintains state between called, remove all stream data source for NSJSON and put use local variable instead. This will make NDJSON simpler, allow it to work with NSURLConnection better and also handle zip streams better.

NDJSONParser set<Source> methods not useful

Change set method to initWith methods because its not useful to change the source. The initWithDelegate method is not needed, change delegate is important for change Deserialization methods.

Missing files.

Two important files are missing NDJSONSerialiser.[hm], can not get git to push them up.

Inconsistent method and class names

Some methods refer to NDJSON as jsonParser as in - (id)jsonParser:(NDJSON*), should refer to NDJSON as jsonSource, perhaps change the name of NDJSON to NDJSONSource

An observe JSON key paths mechanism

I would be good if we could simple add observers for particular key paths, using a delegate and selectors or maybe blocks to respond to particular JSON key paths.
Could perhaps add a foundKeyPath method to NDJSONDelegate to enable this, or alternatively a new object (probable not part of NDJSONParser cluster classes), could keep track of this.

More documentation

A tutorial would be good but more appledoc type of inline documentation is needed, could move some of the information in the readme to the inline documentation.

Add JSON generation

For custom objects the user can implement a method like jsonStringForJSONSerializer:, PLIST object can be handled inline so as not to clutter there interface with an addition method that could potentially collide with other API. CoreData could use the ManagedObjectModel class to determine how to serialise the objects.

Alternatively for custom objects could use the class methods defined in the NDJSONParser informal protocol.

Switching between parse to custom object to parse to CoreData model

NDJSONRequest will parse the entire json request, for CoreData this is an issue because what you actually want put into your store is often a subtree. If we could switch between parsing to custom object to parsing to CoreData model that would provide a way to fix the issue. We can already switch from event driven parsing to another parsing method and back agains, so we just need to find a way to let the parser know the type of parsing has changes for a key. Maybe a CodeData models for keys method like the class for keys and property names for keys.

Add json:foundNumber: delegate method

A lot of the time instead of doubles or longs we want an NSNumber object instead (this is what NDJSONParser uses to call setValue:forKey:), adding this method will also make it possible to use NSDecimmalNumber for numbers that can not be represented by float or long, which is required to support JSON correctly

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.