Skip to main content

  • Login | Forgot Password?
Ribbit Developer logo

Typed Collections in .NET, Silverlight, and Java SDKs

Submitted by gmarcionetti on Wed, 2010-05-12 17:44

We've recently added a new set of objects to our statically-typed-language SDKs (.Net, Silverlight and Java). These objects are a set of typed collections, aimed at making your client code easier to write and clearer to understand.

Previously, if you were using the getUsers() method, your code would have looked something like this:

In .NET:

RibbitCollectionResponse users = new RibbitUser().getUsers(); UserResource user = (UserResource)users.Results[0];

In Java:

RibbitCollectionResponse users = new Ribbit().users().getUsers(); UserResource user = (UserResource)users.getResults.get(0);

We've added a UserResourceList, which implements List<UserResource> in Java and IList<UserResource> in .NET. This gives you a typed resource straight out of the collection. This means you won't have to cast the resources. Developers can now access the collection elements directly, instead of via the Results property.

So your code will now look something like this:

In .NET:

UserResourceList users = new RibbitUser().getUsers(); UserResource user = users[0];

In Java:

UserResourceList users = new Ribbit().users().getUsers(); UserResource user = users.get(0);

Further, this means that in .NET, the collections can be bound straight to DataGrids.

For example, an ASP.NET data grid showing 4 columns from the UserResource object:

<asp:DataGrid ID="UsersDataGrid" runat="server" AutoGenerateColumns="False" OnItemCommand="GetUsers_Click"> <Columns> <asp:BoundColumn DataField="Id" ReadOnly="True" HeaderText="User ID" /> <asp:BoundColumn DataField="Login" ReadOnly="True" HeaderText="Login" /> <asp:BoundColumn DataField="FirstName" ReadOnly="True" HeaderText="First Name" /> <asp:BoundColumn DataField="LastName" ReadOnly="True" HeaderText="Last Name" /> </Columns> </asp:DataGrid>

 

We hope this makes your development a little easier.

  • Code
  • Silverlight
  • .net
  • Collections
  • java
  • open api
  • ribbit
  • SDK
  • Silverlight
  • gmarcionetti's blog
  • Login or register to post comments
  • Share/Save

Ribbit Photos

Ribbit's Webinar SeriesTeam Ribbit Takes the Livestrong ChallengeTeam Ribbit Livestrong UpdateNEW: Ribbit API PricingCloudforce: San Jose 2010Cloudforce: San Jose 2010

See more photos at Flickr

Ribbit Conversations

  • RT @allnick: New: This Week's 10 Most Explosive Facebook Applications http://www.allfacebook.com/most-explosive-applications-2010-08 — 1 week 3 days ago
  • Microsoft IE9 releasing on Sept 15, 2010. http://tcrn.ch/dAODGp <would love all who received MSFT box to donate crayons to a local school> — 2 weeks 6 days ago
  • <sarcasm>Oh how I love keyword spammers. </sarcasm> — 3 weeks 5 days ago
  • How Data Will Impact the Future of Healthcare (Infographic) http://bit.ly/clsGTA /via @marshallk — 4 weeks 2 hours ago
  • @gwmack: Sure, happy to chat your ear off. Please send an email to kristie [at] ribbit.com to get something set up. — 4 weeks 17 hours ago
  •  
  • 1 of 102
  • ››
more

Follow Ribbit

 

            

            

           

Categories

  • .NET
  • AIR
  • Applications
  • Articles and Media Mentions
  • Challenge
  • Code
  • Community
  • Contest
  • Design
  • Events
  • Feature
  • Flash
  • Flash Toolkit
  • Flex
  • Flex SDK
  • Gallery
  • General
  • Inside Ribbit
  • Interviews
  • News
  • Newsletter
  • PHP
  • REST
  • Role Playing
  • Silverlight
  • Tips &amp; Tricks
  • Uncategorized
  • Wish List

Archives

  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • November 2009
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • November 1999

 

               

               

  • Company
    • Corporate Site
    • About Us
    • Careers
    • Contact Us
    • LegalPrivacy
    • News
    • Media Kit
  • Products
    • Platform
    • Mobile
    • Salesforce
    • Oracle
  • Solutions
    • Digital Agencies
    • Carriers
    • Systems Integrators
    • Hosted Contact Centers
  • Community
    • Corporate Blog
    • Developer Blog
    • CRM Blog
    • Moble Blog
    • Idea Wall
    • Events Calendar
  • Support
    • Developer Help
    • Ribbit for Salesforce Help
    • Ribbit for Oracle Help
    • Ribbit Mobile Help
    • Feedback
    • Developer Forums
    • Ribbit Mobile Forum
  • Developers
    • Developer Center
    • Develop for Ribbit Mobile
    • Register
    • Ribbit Labs

© 2010 Ribbit Corporation. All Rights Reserved.