on 27-12-2011 08:59 PM
Well this is a rather noobish question, but I hope this could help others in the future, who want to download stuff from the web and eventually parse it (or process it any other way).
How would it be done the right way regarding the SDK; for instance when someone would like to deserialize XML content and work with it like a domain model?
I would be very grateful to get any feedback for my approach: Pastebin Sample
Is there anything that you'd done differently? Is my sample absurdly wrong and shouldn't be used in any case?
Thanks in advance for all feedback. ![]()
Solved! Go to Solution.
on 27-12-2011 09:30 PM
on 27-12-2011 09:39 PM
Yes there's luckily a good C# XML library included in the SDK and my sample uses exactly that.
I also took the HttpSample and modified it to get the desired result.
But I still wonder if I've done it right considering the "Playstation Suite" framework and it's domain. Am I using the main loop correctly? Does this approach result in any major limitation regarding GUI, etc.?
I'm just curious if it's the right way to go, because I'd continue using that approach and build my small app around that for the beginning. :-)
on 03-01-2012 01:54 PM
When it comes to XML there are many ways to skin a cat.
I do not see anything wrong with the approach you have taken. It uses the XML deserializer, which will work for many kinds of XML formatted content. As long as you control both the generation and the consumption side you wont have a problem.
If you were to process a third-party XML, it might very well be the case that you can not map the XML schema to the limited schema supported by the Xml Serializer (which was really designed for Document/Literal encoding).
If that is the case, you might have to resort to either using a streaming parsing API (XmlReader) or using the in-memory modules (the sexy XDocument or the old and busted XmlDocument).
That said, when it comes to trasfering data to these devices, keep in mind that you might be running on a pretty bad network connection. That the user might be moving from his WiFi at home to a 3G on the road and might even hit spots with bad reception.
This means that you should try to make the data that is exchanged as small as possible.
Try to use gzip compression on the server, and force your client code to request Gzip transfers (see my TweetStation code on GitHub to see how I force Twitter to send me Gzip data).
You might also want to go with Json for encoding, as this is a lighter protocol.
In fact, if you want lighter, you might want to consider protocol buffers.
Miguel
on 03-01-2012 02:36 PM
That's a really nice and detailed answer, huge thanks and many thumbs up for it, really really helpful stuff. ![]()
PSM Developer Registration (for free) on PSM DevPortal is required to post on the forum.
Please sign out then sign in again to the forum and PSM DevPortal after you have completed the registration.
フォーラムへ投稿をするにはPSM DevPortalへの登録(無料)が必要です。
登録後はフォーラムと
PSM DevPortalを一度ログアウトし、再度ログインしてください。


Website ©2013 Sony Computer Entertainment Europe
All content, game titles, trade names and/or trade dress, trademarks, artwork and associated imagery are trademarks and/or copyright material of their respective owners. All rights reserved. [more info]
%%http://community.eu.playstation.com/t5/Announcements/Beta-Trial-Information/td-p/11386362
best_shooter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_driver.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_performer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_footballer.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_fighter.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_creator.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
best_action_player.png%%http://community.eu.playstation.com/t5/Announcements/Introducing-Best-of-PlayStation/td-p/13741979
dev2.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Producer-and-Developer-Ranks/td-p/18407352
trophy.gif%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/The-Community-Awards-FAQ/td-p/18407096
PSlogoSM.png%%http://community.eu.playstation.com/t5/Website-and-Forum-Help-Feedback/Online-Support-Coordinator-rank/td-p/18414870