Coding 101 38 (Transcript)
Father Robert Ballecer: On this episode of Coding 101, MVVM, the model view view model you’ve probably had enough, but that’s too bad because we’re going to use it. As we continue to build our app.
Netcasts you love, from people you trust. This is TWiT! Bandwidth for Coding 101 is provided CacheFly. At cachefly.com.
Coding 101 is brought to you by Lynda.com, Lynda.com is an easy and affordable way to help you learn. Instantly stream thousands of courses created by experts on business, software, web development, graphic design, and more. For a free trial, visit Lynda.com/c101. That’s Lynda.com/c101.
Fr. Robert: Welcome to Coding 101, it’s the TWiT show where we let you into the wonderful world of the code monkey. I’m father Robert Ballecer, the digital Jesuit. Shannon Morse is currently in Chicago looking at a giant reflective bean. That’s right, we sent her on a mission, she will be back next week, but she’s got some special, special stuff going on in Chi town and we wish her well. Now, taking her place, at least just for this episode, I didn’t think it would be right just for it to be me, so we brought in a special guest a little bit early. Ladies and gentlemen, our code warrior, my good friend and just a heck of a guy, Mister Lou Maresca, senior software engineer over at Microsoft. Lou, thank you for coming in and stepping in early. I know your segment doesn’t normally come until the end of the show, so I appreciate you being willing to jump on in.
Lou Maresca: Of course, yeah. Great to be here.
Fr. Robert: I do have to say it’s nice to have you but I’m used to having Snubs right here. So when I speak to you, I’m just going to look over here because that’s kind of habit. Is that cool?
Lou: You’re off balance a little bit. Maybe we should move it a little bit.
Fr. Robert: Lou, I thought we should probably start with a little bit of some coding news. We’re not going to do example this week because I want to leave that for Snub’s compiled. But I heard a little something, something from one of the programming journals that I read, Science Daily, talking about a new system that some researchers have come up with. That could potentially change the way that we program for the internet and in fact, change the way that we surf the internet. They wanted to develop something to make internet surfing safer and so they came up with COWL. That stands for Confinement with Origin Web Labels. It’s a system that works with Google Chrome developed by researchers from the University College in London, Sanford, Google, Chamers and Mozilla. It prevents malicious code in a website from leaking sensitive information on a user’s computer to 3rd parties, while still keeping cross server connectivity. That’s the ability to call on multiple servers at once to complete a page load. Now Lou, of course, you do this for a living, so you understand how difficult that challenge is. This idea of confinement has been around since the 70s, but it’s hard to achieve. Do you understand why? I mean, it sounds like such a good idea, to make sure that an activity stays within a given application, but when we deal with the internet and applications, it’s hard to implement.
Lou: Yeah, I mean, because the internet by itself- I mean, most browses are supposed to be sandboxes, where they’re basically isolated from the rest of your computer operating system: Mac OS, Windows, and they’re supposed to be allowing you to execute code in those that are just isolated to those processes. But when you’re talking about information, a lot of these—like Explorer or Firefox, they store personal data. And so when you allow code execution in them they can leak that information. So it’s a very, very tough problem to kind of handle from that perspective.
Lou: Yeah, I mean there’s a lot services that do that. For instance, a lot of these tower services for children that you want to funnel websites through, they do something similar. Amazon Silk browser does something similar. We have to send it through a service and then it comes down to your device. They can potentially, in these services, these proxy services, they can filter things. And that makes it so that analyzing data that comes down, if it contains personal information, peoples names, user names, passwords, ids, addresses, if its personally identifiable or what they call PII, then that service can somehow strip that data out if they try to send it out again somewhere. Like across a domain, a different webserver, that sort of thing.
Fr. Robert: Right, right. Now we do have a note here in the chatroom from N5, who is asking me to needle you. Because Microsoft released a new version of C Sharp today, is there anything we should be rushing out to download?
Lou: So there is always patches. There’s a patch to .net as well. There’s another compiler called the Roslyn complier and what it is, is it’s a compiler that was built entirely on C Sharp. So it’s actually a C Sharp compiler, built in C Sharp. It’s kind of unique in that sense. So they’ve released a new version of that and that makes it so that services like Zamrin that can convert your code from C Sharp and then make it light and compile it down to iOS or Android type code. Allows services like that to kind of build on top of it. What it also allows is potentially compiler as a service. Which means, you can go online, open up some kind of service that allows you to write some code in it, and it will immediately allow you to compile that code as a service in there. So that was also kind of like they released another version of that too today. But that shouldn’t really affect the apps that we’re building, because we’re still building on top of the fundamentals of C Sharp really. And those haven’t changed for a really long time.
Fr. Robert: Right. So if you’re an advanced programmer and you need something for your next project, go ahead and check it out. But for our project, everything is going to work the same. Speaking of our project, Lou, lets jump into a little bit of Ivory Tower. Now last week we talked all about using APIs. And the back end of our application. So remember, we’re building an application that can do various things surrounding our task management. Now we accessed, via a series of classes, the APIs from Google, after you showed us how to authorize ourselves, so that we could use their services rather than building our own. And just get the data that we need, modify what we need to, and then push back into Google services so that we can synch across all devices. I want to talk about a little something, something that we mentioned back in episode 35 of coding 101. And that is the model view view model model of programming. MVVM. Lou, if you could break it up really quickly, tell people about those 3 parts. The view, the view model, and the model.
Lou: Sure. So one of the things to pay attention to is it’s just a long acronym. Microsoft likes acronyms, I’m sure all big companies do. But really, just to kind of pay attention to, for instance, a view is what you see. So it’s basically a view of some data, how it looks to the user is the view. The view model itself is converting data that you get into what you can see. And again, what the user enters, back into a way to store that. So it’s kind of like a conversion process. That’s what the view model is. And then of course the model is basically a way to get the data. So is it coming from a file on your computer, a web service, a database, where is that data coming from? That’s what the model will represent. It’s just a way to wrap a class or an object around data itself.
Fr. Robert: Right. And you may remember from episode 36 that we had a user Joe, who used one of the wonderful properties of this model in order to reskin our program. We created a podcatcher that used a RSS feed input in order to download available podcasts that you could just then click. He was able to change the look and the feel of the application by altering the view. And that’s why we like this. Because you can change one part of the program without having to completely rewrite the entire thing. Now if we were to put this into the context of building our app, that model, that back end, the part that actually talks to the outside world, it’s sort of our bridge to external data sources, that’s what we were building last week. We were teaching people how to get that data into the program from data sources.
Lou: Exactly right. So in our case, our source was you’re getting data from a web service in that case. Google calls it a rest service. But there can be many different places to get data. We’ll show you another way, maybe in another episode, we’ll show you a way to not only get the data from the service, but maybe we want to store that data locally so maybe you don’t have to get it from the service all the time. So now that model becomes another spot that would be maybe your hard disk or somewhere else.
Fr. Robert: Right. And again, the way I always think of it is, it’s my back end. Its stuff that’s doing the heavy lifting to make sure that I have the data available for my program. Now there are going to be people who say “well I get it, if that’s the back end, then how that is different from the view model?” Now we know that the view model is the interface between the model and the view. So between that data that it gets and what we actually see, how we interact with the program. Explain to people why we’ve separated that. Because it does cause some confusion. There are a lot of programmers that are going to say well, why don’t I just do the data sorting and the data parcing in the model? Why do I have to have that second piece?
Lou: It’s a good question. There’s a lot of times where people like to combine those two because it kind of makes sense in that case, but the thing is, most applications, users don’t necessarily know what they want so for instance, I might want to show all task lists, I might want to show just the list of tasks, but I also want to show a list of tasks that are on a specific date and are sorted in a specific way. And when I get it out of my web service, when I call Google service, I can’t say hey, only give me tasks that are older than 2 months. So what will end up happening is I have to get a list of tasks, the model will give me that big list of tasks, and then in my view model layer, I’ll have to rip through it, sort it, filter it out, and then make a nice little tiny package to hand off to my view. And then my view says oh, here you go, here’s your list of tasks that are filtered and sorted like you’ve asked for. And so that’s kind of the key. Is that’s really where the view model comes into play. Is when the model can’t do it for you, it just give you a big blob of stuff and you just have to be able to handle it.
Fr. Robert: Okay. And that last part, the view- I think this is probably one of the most self-explanatory- it’s what we see. Now we need to remember that the view model can actually decide what’s the appropriate data to put in the view. The view can make it pretty, it can decide where things go, but how you actually interpret the data that the view model is getting from the model, that’s done in the view model, it’s not done in the view. We, today, will be messing with the view model. So now that we have got a way to get all that external data into our back end, into our model, Lou is going to show us how we take that and turn it into something useable. Lou, why do I need that step? There are going to be a lot of people saying wait a minute, the data that I got in from Google, why is that not already in the format that I can use?
Lou: So like I said, Google will give you the data in a specific format and then you might want to do other things with it. And that’s what they call the requirement to the application. So you need to kind of list out what you want your basic functionality of that app. and then once you list that out, you can decide okay, is the model giving me what I need? If so then the view model is just kind of a pass through. But as time goes on, as you build out more of the features, what we call MVP, what we call minimum viable product. The smallest amount of features that you can ship your product with, and so when you have an application you have to think about what’s the minimum that I need to be able to do? And is the model going to give me everything I want. And in this case, Google is not. They’re going to give us a lot of tasks and task lists, but there’s simple things like, they only allow you to receive a task by giving an ID. I don’t know about you but users don’t really care about the tasks ID. They only know, okay I have this task and its named grocery list. They don’t know that the ID is some long string. So in order to mask that functionality, in the view model layer we’re going to convert the ID to a name of the task. This way when you’re showing it to the user, they’re only seeing the name, and then when you go and retrieve more details, you use the ID. So that’s kind of the key to the view model.
Fr. Robert: Right. any of our views who has actually played with an API… maybe you’ve solved the notes from last week and you’ve decided to sign up for your own API key, you saw the strings that you were getting from Google, and like you said Lou, it looks like gibberish. There’s a lot of data there that if you just pushed out into the view, people would scratch their heads and say what exactly am I looking at? That’s what you need the view model for. The view model is going to parce that and it’s going to turn it into something that’s presentable, and then it’s going to decide, you need to see this string and this string, you don’t need to see the ID, you don’t need to see all this extraneous data, this is what you want. Now let’s talk a bit about something that we missed last time we talked about the MVVM. And that is data binding. This is actually very important when we start talking about an application. The old style of programming was you execute a program, and then it dumps a bunch of data for you. We want something a bit more advanced. We want to be connected in two ways. Can you explain what data binding means Lou?
Lou: Sure. So data binding is a way for your UI to kind of bind to the view model in a way where it can communicate. So for instance if the view model gets new data, the user interface, the view, needs to know that there’s new data there so that it can refresh to the user. So that binding- there’s multiple ways of binding. There’s one way binding, meaning, just the user entering the data and then updating the view model which then goes and updates the view. Or there’s the other way which is reverse binding which means the view model will only update, which we call read only. Meaning we’re only getting data from some data source, some model and displaying to the user. Or there’s a read right, meaning you have the ability to bind to your view model and the view model will update the view and the view will update the view model. So there’s ways to bind those things. And those happen usually at a lower layer, so that I think the example that Mike gave, he showed his XAML application. And all he was doing was just binding to a service to an XML document. And it was basically updating the view as it got the data from the service. So that was a one way binding. What we call a read binding. Updating the data from the view model to the view. And it immediately showed the data. You didn’t have to do anything else, the UI just immediately rendered it for him. So that’s kind of what the data binding is all about, is you shouldn’t have to do anything. All you have to do is bind something in the view model and then the view model will either update it or save it, that kind of thing.
Fr. Robert: Right. And we bind because we want that sort of interactivity. We want the view, what we can see, to automatically update depending on the data that’s coming into the application. Otherwise, it’ll be like the old style, just hitting the F5 key over and over again to refresh your browser. That’s kind of silly. You want there to be some sort of bidirectional control. We actually have a good question in the chatroom from Irene who wants to know why she would use MVVM instead of MVC, which is Model, View, and Controller. It’s another way of looking at programming.
Lou: Yeah so that’s a very good question. I think that MVC- MVVM was developed for the XAML way of doing things. So it’s really kind of built off of the concepts of MVC, they’re just two of the same kind of concepts. MVC is model, you have a data source, your view, and then the controller of that data. Taking the data from your model, updating the view and vice versa. So it’s kind of the same concept, it’s just MVVM was another acronym that we could create. It’s really centered around XAML or XML for applications and that’s really what Windows store apps, or Windows apps are today. So that’s really just what that’s for. But it’s very similar concepts, you’ll look them up on Wikipedia, do a comparison of it, it’s pretty much the same base stuff.
Fr. Robert: Now Lou, when we come back we’re going to be getting into the actual application building. We did our first part, we got access of the APIs, then you’re going to show us how we actually start taking that data and turning it into something useful in the view model. But before we do that, I want to take just a moment to thank our sponsor for this episode of Coding 101, and it’s Lynda.com. What is Lynda.com you may be asking yourself? It’s a one stop repository for all the information that you need about the software, the skills, and the services that you’re trying to develop. Lynda.com is an easy and affordable way to help you learn. You can instantly stream thousands of courses created by experts on software, on web development, web design, and more. Basically anything you need to learn, you can find it on Lynda. They work directly with industry experts and software companies to provide timely training, often the same day new versions or releases hit the market. So you’ll always be up to date. They also have their courses produced at the highest quality. That means that you’re not going to get shady lighting and really dodgy audio. You see that a lot on YouTube videos. Which I love. And that is one of my primary sources of learning. I came from YouTube. But there are times when you don’t want to have to worry about someone’s shaky hand or someone’s horrible audio quality. You just want the information and that’s what Lynda.com gives you. In addition to that they have tools that include things like searchable transcripts so you can find particular parts of a view that you’re looking for. If you need reference- let’s say that you’re doing premier and you don’t need to know everything about premier, you can find a specific part of premier that you need. Or let’s say that you’re programming with Python and you’re already a programmer, but you’ve forgotten one particular command that you need. You can search for it and Lynda.com will forward you to the part of the video that talks about that command. That’s part of the service that is Lynda.com. Whether you’re a beginner or advanced, Lynda.com has courses for all experience levels. You get to learn while you’re on the go with Lynda.com apps for iPhone, iPad and android. And their low monthly price of $25 gives you unlimited access to over 100,000 video tutorials. Premium members of Lynda.com with an annual plan can download courses to their iPhone, iPad or android devices and watch them offline. Which really does make this the ultimate reference for pretty much everything you might do. Lynda.com also has courses on the up and running OS Lynx, practical cyber security, amazon web services essential training, which is hot right now, and it also costs a lot of money, unless, of course, you were to do your courses with Lynda. And up and running with symphony 2 for PHP. So if you’re a programmer Lynda.com is an absolute vital resource for you to have. For any software that you rely on, Lynda.com can help you stay current with software updates and learning the ins and outs to be more efficient and productive. We’ve got a special offer for you to access all of the courses free for 7 days. Visit Lynda.com/c101 to try Lynda.com free for 7 days. That’s Lynda.com/c101. And we thank Lynda for their support of coding 101. Now Lou, let’s get right back into business. Now that we’ve got access to the APIs and we’re assuming that we have the ability to access the tasks service on Google servers, what do we do with it?
Lou: That’s right. That’s one of the things that we kind of talked about is establishing what you want to do with this application. And I think with the tasks app there’s some base things you want to do. One thing is what we call CRUD in the application world. CRUD is another acronym and it basically means create, read, update and delete. Those are just things that you would want to do with normal things like tasks. I want to be able to create them, I want to be able to read them, I want to be able to update them, and I want to be able to delete them. So those types of things we need to add functionality to the view model so that we can say okay, let’s go talk to Google services and say hey, let me go create one, let me get a list of them, let me update them, let me delete them. I think today we will just focus on just getting and reading those tasks. But that was kind of the first part of the functionality. Another thing is maybe we should list what else we want to do. What do we think the UI is going to do? So sometimes people sketch out an app and how they want it to look. And so for instance, for me, one of the things I would want to do is let the user choose a list, get a list of lists, and let each user choose a list and expand that list and look at all the tasks underneath it. And so that functionality alone is going to require us to write some underlying methods to do that functionality for us.
Fr. Robert: Okay, so the outlying is, we’ve got access to Google’s API, we can access their servers. We’re now going to pull down data. Pull down information, and in some way or form, we’re going to write a procedure that will turn it into useful information.
Lou: That’s right.
Fr. Robert: Let’s go.
Lou: So there are a couple things you can do. In visual studio, this is just the console application I told you we were going to try to use to try to test the app. but we have this other class that we’ll call task manager. And what it basically did is it just basically logs in for you. That’s all it does today. What we call authenticate asynchronies, it initializes the service. And you can look through the code to see how that works for that. But we want to do is we want to add this. So what we want to do now is add another method to this where we talk about getting a task. So what we can do is we can return a Google task of some type, like let’s say we want to get it by name. The problem with getting it by name though is, let’s call it get task by name. The problem is that the Google API doesn’t actually allow us to get it by name. They kind of deal with IDs. But let’s look at what the service can do. So if we do service. You’ll notice that there’s a couple of different other objects in here. One of them is called tasks, and one of them is called task lists. So what we could do is, just up front, let’s say we wanted to get a list of tasks from a specific list. So there could be- let me show you an example, it might be a little confusing since its lists of lists. This is kind of like the little task bar that you can do in Google. And you notice down here I can actually create different lists of things to do. Like for instance, what’s today’s task that I have to do? I have to pick up the dry cleaning, I have to pick up the kids at soccer, that kind of thing. Or I can go to my grocery list, and say okay, this is my Monday list, this is my task for Monday. Go in here, I’ve got to get apples and flour. So this concept of lists is just a hierarchy. It allows you to get a list of tasks and then inside that list of tasks, there’s a bunch of tasks, and those tasks have things inside of them. That make sense?
Fr. Robert: Yeah.
Lou: So basically, if we come over here, we can say well, okay, I want to get a list of tasks and just give me that list for potentially the default lists. So if I don’t actually have the name of a list, I can say, give me the default list. So this basically says okay, I’m going to actually execute and get the default lists. So that default list, I’m going to create a variable, and now this basically allows me to create a function to get a default list. So I can actually execute that and there’s four different ways to execute it. We’ll just pay attention to this one execute. And that will basically return to me, the list.
Fr. Robert: Got it. So what it’s doing is because you need to get the ID, this is, this little procedure right here, all it’s going to go into the API, it’s going to say I’m looking for this particular list, the default. Give me the ID string so that now I can play with it.
Lou: That’s right. So for right now since I’m not returning anything, the easiest thing for me to do is change this to avoid because I don’t want the compirarchy to yell at me. And so I’m not going to return anything. But let’s just execute this. Let’s just run this. So the way we actually execute is we have to test the code. So let’s pop over to our program. And in here we’re going to manager.get task by name. And we’re just going to put in a blank here for now. Because we’re just getting a list of tasks. But right now we’re doing default. So I run this guy, going to compile and...Okay. It didn’t like something. What didn’t it like? It says… gotta make sure that we write this code correctly. So it actually was tasks.lists. Okay so default. Let’s run that again. Okay so it’s going to stop here and I’m going to step into this guy, and it’s going to pop over here. And the first thing it’ll do is it’ll create this, so ill hover over it, it’ll show you its creating this special request. They call it a task request. That’s what this get default is. And then I’m going to run this guy here. Now it actually returned a list. If I look inside there, there’s items. This is another property in it. And there’s three items. There’s three tasks. If I look inside there, there’s a couple of tasks.
Fr. Robert: Yeah, I could see why you would want this. Because you don’t want to have to use that ID string every time.
Lou: Exactly right. So that’s kind of the idea. This is the ID of the task. I don’t know about you, but I don’t really care.
Fr. Robert: Exactly. That’s one of those things where that should be hidden. The user should never have to see that part of the task. That part of the program. So you’re just going to write a procedure that converts the name into the ID, and vice versa.
Lou: Right. So now we have the option, what we have here is we could just return the task here. Or we could just return the name of the task if they want more details on that task they could return that. But again, the key here is you can’t return a specific task by name, you have to use the ID. If I were to pass the name in now, now what I would have to do is kind of like rip through this thing and I’d have to find the task. So we could do like a for each through it. So I could say for each task in the list, and then I would basically say, okay, for that task, let’s get the specific, actually I should probably name this task list.
Fr. Robert: So let’s say that you need to change your Google keys after the show, but you had your Google keys actually in a different part of the program.
Lou: Yes, exactly right. Yep. So for this task, I’m going to basically say hey I want to go through each task in the task list. Actually I can’t for each through it. Actually because it’s the task list items that I actually use. I have to remember. There’s some properties in here. If you look inside here it’s called an I List of tasks. So then I’m going to loop through each one of those. And say okay, if the task equals the title. So if task.title. And there’s a way to compare it where you can send it all uppercase or all lowercase. And I’m going to send it all lower case. If it’s equal to the name, all lowercase, then return the task. So now I need to just change in here- change it to be actually returning a Google task here.
Fr. Robert: And we actually did cover this in the first C Sharp module of Coding 101 when we started stepping through arrays to return variables. That’s all he’s doing. He’s just doing it through an API and he’s doing it with strings. He’s going to go through each element that the API allows him to access, and he’s going to copy it into a variable that then becomes useful information.
Lou: That’s right. So again, there’s many different types of loops. I could have done a four loop here and then I could have said item.pound and then I could have said only run this for this many items and then we would loop through and kind of like this method where we use the index number of the item. So I could have done that as well. For each is a little easier for me. So I use that instead. So then all this code is doing is just comparing. Is it the title in lower case is the same as the name that I’ve tasked in lowercase? If it is, return it, otherwise make it null. And so now what I can do is, I can actually go back to the program and use it in the way that I expected to get it. So I’m going to change this to return a task, and then I’m going to put a name in here, so like I think one of the examples I had in here was this would be Monday’s list. So I can go and say maybe Monday list, that’s the name of my task. So I can now run this guy again, and it should be able to kind of jump in here. And I’ve got a bunch of tasks lists, I’ve got a bunch of tasks and I should have, probably count to three there, yep. That makes sense, and then I’m going to loop through each one and oh- that one didn’t match. And this one is if this title then that title. This one didn’t match, and this title is blank too. Looks like the default task list in this case didn’t have anything so it’s just going to return null. Meaning it didn’t get anything back. And so then the task list is null. So I just chose the wrong task list in this case. I had to actually send in a different list name.
Fr. Robert: And we have a question in the chatroom from D Medley who wanted to know what variant data type are causing to--- in C Sharp it’s actually dynamic. So it’s going to choose the one that’s automatically the best for whatever data you’re pulling in.
Lou: Yeah, and you know what, that’s a fantastic question. That’s actually my fault because I’m so used to using this now, because it’s so much easier, that I use it all the time. So what you can do is I can change this to be a little bit more specific. So this is called actually a list request, and then this task is execute, returns again a list of tasks. So I can change this to a list. See how much harder it is? I actually have to type all this stuff. So it’s much easier for me to just task list, so there’s a lot more typing. So that’s why- exactly right, using --- allows the compiler to basically determine that all for you. So you don’t actually have to type all this stuff. So that’s really what all that is. So I just go back to using --- if I hover over this, it’s going to tell you that task list is actually a list of tasks. Or tasks. That’s really it. That’s the first part of the code to get the task by name. So now when I say okay, well a user will tap on a task in our UI, then they can basically go and retrieve that task by just using the name rather than that funky ID that you had.
Fr. Robert: But the interesting thing is, again, we’re trying to make it as transparent for the user as possible. When the user taps on it, that’s then bound back into the view model, the view model will then say okay, he wants this particular element and thanks to the processing that it already did, it knows that that particular task is attached to this particular ID, which it can then send to the model, which the model will pull from the API, and then will go all the way back to the view. Which is what we want. This is the kind of process that we want because it makes it very easy for us to know where things are happening in the program.
Lou: That’s right, yeah. So a lot of the time the view model is going to have a lot of logic in it. Sometimes people like to even break that up. The model sometimes is very simple. Like in our case, it’s the service and we might have to tweak some stuff from that service, we might want to add another layer to that, maybe we could create another class called the task model and then that would just be data that came back to the service. So you could do a little bit of work in there, but sometimes it just you calling in the service itself as the model. But in this case the view model has to do a lot of work. Because I can’t actually get a task by name, I’ve got to use the ID. I’ve got to actually do some work to write some code to return it like that.
Fr. Robert: Yeah. Our view model is really the business logic. That’s where everything is taking place. Because if you just took the data from the model, you would just have a bunch of user IDs along with tasks, and it would look horrible. If you just had the view, you would have nothing to present it in. the view model is going to take both the commands from the user and the data that its getting from the model and make them interact so that when you tap on something, it actually correlates to something else. Now what else do we need to know about this? Of course there’s a lot more we have to add onto the view model, but is there a crucial step people should be playing with? Now that they have a way to get the data into the model, now that they have a way to use the view model to scan through the data that’s coming in, in order to find the user ID and to fill individual tasks into variables, what’s the next step that they should be taking?
Lou: I would play with the interface, because like I said, we have different requirements. We want to be able to read, update, delete, and there’s different levels of those. So for instance, read, we need to be able to read the lists of lists, we need to read all the tasks inside of a list. We need to be able to then display the content of that task to the user. So look at those classes, those objects, Google task object, to see how you’d kind of extract that data off of there and then that’s where when we hook the UI up, we’ll actually hook it up to that object, to that tasks title, to that task’s content. And so really just play with the interface and see if you can do those reoperations. And then actually creating is very similar. We would basically use service that tasks that create, and we would do it that way. Again, just play with it and just understand what your fundamental goal is for the app right. You understand there’s specific functions you need to do. And then we just need to fill out the view model to do all those functions.
Fr. Robert: Right, right. And folks, don’t forget that you don’t have to copy things that you saw off the screen. We’re going to make all of this code available. It’s going to be bundled up in a nice neat package. That will be available on our show notes page. We’ll tell you a little bit about that later on. Lou, we’ve got two more episodes to wrap up this app. now that they have information in and now that they’ve got some rudimentary steps in order to process that information and turn it into something that’s usable, what’s the next thing they need to learn in next week’s episode?
Lou: So I think next week, once we have that view model kind of constructed, we’ll kind of fill it out a little more and I think the example I’ll give, I’ll even give you a create example in there. So we’ll have a read and create and we can kind of talk about how to read more data and maybe delete stuff. But I think the next step is then hooking that up to some kind of UI. That’s what people really like to see. The code is sometimes fun for me, but not as fun for everybody. So some people want to actually see it in action. So then I thought we’d talk a little bit about data binding and how to get that data bind to that view layer. Whatever that view layer might be. It might not be that pretty at first, but how to kind of get that binded in there.
Fr. Robert: I think they’re really going to enjoy that. Because once we get past all the logic, they actually get to start customizing how their app is going to look. Because you can have all that stuff going on in the background and your app may look completely different from what someone else’s looks like and I think that’s going to be a lot of fun. Lou, thank you so very much, especially for stepping in for Snubs who is currently with a giant reflective bean in Chicago. It’s always so enjoyable to talk to you because you do this for a living and this is your work and obviously you are our code warrior. Could you please tell the folks at home where they can find you? If they want to find more about the work that you’re doing, find out about some of the other activities that you’ve been playing with, where should they go?
Lou: Definitely. Always twitter.com @LouMM, and about me, LouMM, and of course all my work as usual is on Serym.dynamics.com. That’s all the stuff that we’re coming out with, soon to a platform near you, you could say.
Fr. Robert: Ladies and gentlemen, Lou Maresca, senior software designer for Microsoft, my friend and our code warrior, we salute you. Don’t forget that you can find all of our shows at our show page. Just go to twit.tv/code. There you’ll not be able to just download, but you can also subscribe. If you want to get our episodes automatically on your iPod, your iPhone, your zombie Zune, your laptop, your desktop, whatever it may be, we’ve got a choice for you. And those links are absolutely important because you’re going to be able to find our show notes. The links to either the collective packages that we’ve been talking about, or the GitHub that stores some of the code for some of the programs. Make sure to go there so that you can step through the code as we’re talking about it. It’s a much better way to understand what’s going on in the show. If you get lost, download the package and see if it makes more sense if you’ve actually got it loaded up on your computer. Don’t forget you can also find us on iTunes and on YouTube at youtube.com/twitcoding101. But the best place to find us has got to be our Google + community. Just go to plus.Google.com/twitcoding101. You’ll be able to find out what’s going on in our community. It’s a very strong community. And if you ever have a question about how to program or a question about a program that you’re writing that’s not working properly, this is a great place to go and have your questions answered by experts. By people who are actually doing this for a living. It’s part of this experiment that is twit.tv. Don’t forget you can find us on twitter, snubs is normally at twitter.com/snubs. You can find me at twitter.com/padresj. That’s @padresj. If you follow us you can find out what we’re going to be doing on every episode of coding 101 and you can also follow us to see what we’re doing in-between episodes of coding 101. Don’t forget that you can watch us live every Thursday at 1:30 pm pacific time, at live.twit.tv. If you watch live you can see what we do before the show, after the show, and any bloopers that we may accidently put in there that gets taken out in the final wash. So if you want to be an extra special code warrior, go ahead and jump in and as long as you’re going to be watching live, jump into our chat room at irc.twit.tv. It’s a great place to hang out, and as you can tell, I pull questions from the chatroom to give to our experts and our code warriors. Until next time, I’m Father Robert Ballecer, and the invisible woman here is Shannon Morse. End of line!