[Chicago] Communicating across layers in a webapp

Chris Foresman foresmac at gmail.com
Mon Jan 26 19:11:51 CET 2015


If you’re talking about your own front end and back end, I’d avoid using XML for data. JSON is really the only data format most web services uses these days—it requires much less processing to encode/decode, and every major language tends to have constructs that map directly to/from JSON. XML was only ever meant for machine reading, true, but I’ve never run into an API that used it unless it was built in Java.


Chris Foresman
chris at chrisforesman.com



> On Jan 26, 2015, at 12:04 PM, Randy Baxley <randy7771026 at gmail.com> wrote:
> 
> You are of course correct.  For buses Harper Reed's server per David Beazley's Pycon talk has been useful during initial development and something like that will be set up when moving to production.  The current problem is much simpler.  Just wish to set up a server and pass information back and forth between frontend and backend.
> 
> On Mon, Jan 26, 2015 at 11:42 AM, Chris Foresman <foresmac at gmail.com <mailto:foresmac at gmail.com>> wrote:
> From my experience working with the CTA’s byzantine API, you’re better off writing your own proxy server that periodically polls data about stop locations from the tracker service and  maintaining your own database of locations. Use that to figure out what stop or stops are applicable and then use a translating shim to request data on buses or trains for that location.
> 
> 
> Chris Foresman
> chris at chrisforesman.com <mailto:chris at chrisforesman.com>
> 
> 
> 
>> On Jan 25, 2015, at 9:12 AM, Randy Baxley <randy7771026 at gmail.com <mailto:randy7771026 at gmail.com>> wrote:
>> 
>> Sorry, the to should be:
>> 
>> https://github.com/randy7771026/Visual-CTA-Chicago/blob/master/sbte.py <https://github.com/randy7771026/Visual-CTA-Chicago/blob/master/sbte.py>
>> 
>> On Sun, Jan 25, 2015 at 9:09 AM, Randy Baxley <randy7771026 at gmail.com <mailto:randy7771026 at gmail.com>> wrote:
>> Thank you Tanya though not what I am looking for, I think.  If I can ever get anything working in Django it might be an option.
>> 
>> For now things are extremely simple but they will get very complicated as the code grows.
>> 
>> Right now I want to pass the latitude and longitude from:
>> 
>> https://github.com/randy7771026/Visual-CTA-Chicago/blob/master/index.html <https://github.com/randy7771026/Visual-CTA-Chicago/blob/master/index.html>
>> 
>> to:
>> 
>> https://github.com/randy7771026/Visual-CTA-Chicago/blob/master/index.html <https://github.com/randy7771026/Visual-CTA-Chicago/blob/master/index.html>
>> 
>> replacing lines 48 and 49.  Then my python does things and writes some things that I will want to send back to the web side but then eventually back to python.  CTA still uses XML so for now I am thinking I want to stay with that format but in the future may switch to one of the more modern formats.
>> 
>> I will eventually have to decide if I want to create cookies or keep a database and issue uids and pswrds.
>> 
>> On Thu, Jan 22, 2015 at 8:30 AM, Tanya Schlusser <tanya at tickel.net <mailto:tanya at tickel.net>> wrote:
>> I cannot make it to Project night, but may I recommend Tablib <http://docs.python-tablib.org/>, another Kenneth Reitz gem, that does just what you asked?
>> 
>> http://docs.python-tablib.org/en/latest/tutorial/ <http://docs.python-tablib.org/en/latest/tutorial/>
>> 
>> >> I am wondering if we might be able to build a tutorial that any
>> >> Grey Haired legacy programmer could understand for this process
>> >> that addresses the parsing of XML, JSON, XSON and cookies when
>> >> designing and implementing a project then include that in the project
>> >> night resources.
>> 
>> 
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org <mailto:Chicago at python.org>
>> https://mail.python.org/mailman/listinfo/chicago <https://mail.python.org/mailman/listinfo/chicago>
>> 
>> 
>> 
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org <mailto:Chicago at python.org>
>> https://mail.python.org/mailman/listinfo/chicago <https://mail.python.org/mailman/listinfo/chicago>
> 
> 
> _______________________________________________
> Chicago mailing list
> Chicago at python.org <mailto:Chicago at python.org>
> https://mail.python.org/mailman/listinfo/chicago <https://mail.python.org/mailman/listinfo/chicago>
> 
> 
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150126/7ada941e/attachment.html>


More information about the Chicago mailing list