MySpotify Demo App – RESTFul Web Service Introduction & Object Oriented Programming


Sample result

This application does the following:

  • Search the artist library of Spotify
  • If there’s a result, display it as a list together with a base image if available.

The  project technically demonstrate the following:

  • Consuming web service
    • Basic web service call
    • Downloading image from a URL
  • Object Oriented Programming – Classes, Inheritance
  • LINQ basics
  • .NET List object
  • Parsing result using JObject using Json.NET

Web Service Basic Concept

If you are not yet familiar with web services. Please read the following article before jumping in to the source code, so you will fully understand what is going on.

Basically, every web service call requires a “REQUEST from the sender and a “RESPONSE from the receiver. Here, our sender of request is our app – which is requesting artist information , MySpotify while the receiver of our request is the Spotify API.

Object Oriented Programming

We also cover here OOP concept – inheritance. Here – we created two class:

  • RESTService – This class is responsible for doing basic web service calls and some helper function like building query string for easier building of URL for calling and downloading images based from a provided URL.
  • SpotifyApi – This class is specifically made for calling the Spotify API. It also has sub-class, ArtistModel.

SpotifyApi needed the functionality of the RESTService, RESTService doesn’t need SpotifyApi functions – So here, we will just let SpotifyApi inherits RESTService sub routines and functions, then we will create Subroutines specific for the SpotifyApi requirements.

ArtistModel class is used for storing information about the list of artist. I encourage you doing the same if you need to process a set information.

If you want to learn more about inheritance, visit

Programming Language: VB.NET (Visual Studio 2010)

Project References:

Source Code:

Note: If you need to integrate with Spotify, there are existing libraries out there that can be use – please use that instead. This project was meant for web service demonstration purpose only.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s