Coding 101

Sep 25th 2014

Coding 101 36

C# Collections

Lists, arrays, dictionaries, and hashes.

Although the show is no longer in production, you can enjoy episodes from the TWiT Archives.
Guests: Louis Maresca
Category: Help & How To

The Code for today's show is available below:

XAML Podcast App

Snubs Compiled

Ivory Tower

Consider our Example Podcasting App:
In talking about the advantages of Object Oriented programming, we've often talked about the ability to cut big problems into their component parts, which can then be coded. The Podcasting App is a good example of breaking down problems into their component parts.

  • Question: What needs to happen for this application to work?
  • Answer: There are actually two parts of this application
    1. The part of the program that accesses an external data source and makes that data usable by some sort of user interface.
    2. The part of the program that presents that data to the User

Let's do that 2-Step process right with the "Model View ViewModel"

The "Model" is an object that contains all the data and information that we have to use.

The "View" is the UI: It's the later that the User interacts with. Some call it the "presentation". The View can take the data and information contained within the "Model" object and organize it in order to make it more presentable to the user.

The "ViewModel"

  • This is the "interface" between the Model and the View
  • This is the piece that introduces "Presentation Separation"
    1. It gets to decide which data from the model is place in the View
    2. It gets to decide which input from the view (from the user) is pushed back to the Model
    3. It can change and reorganize depending on the data that is in the "Model"

In our example:

  1. The "Model" is the object that interfaces with database of videos we've made available
  2. The "ViewModel" is the object that handles the RSS feed, choosing which data to pull from the "Model" and make available to the "View"
  3. The "View" is a XAML that takes the data made available by the "View Model"

Get in Touch With Us!

Bandwidth for Coding 101 is provided by CacheFly.