Introduction / Object Oriented Development
Subtitles of the Movie
Now before we go any further in the class I want to stop and talk about Object Oriented Development because, number one, you can't develop in a modern language anymore without being familiar with Object Oriented Development and you're going to hear various aspects of it mentioned by me in this course and in everything that you read about ASP.NET, because ASP.NET is based on the .NET Framework which is object oriented. Now let's talk about this just a little. I would hope that say 90 to 95 percent of you folks watching this training video know what this is. In case you don't, I'm going to go through it real quickly here. If you don't you need to read up on this. If you do and you've just kind of dipped your toes in the water here, you need to go ahead and jump in and get on the bandwagon here with this. This is some really cool stuff. First of all, Object Oriented Development, you may hear it called OOP or Object Oriented Programming, but the idea here is this a programming methodology that we use to build our applications. The functionality of the application is basically segregated off into sections based on functionality and it's programmed into these "reusable" objects. So let's say that we need a piece of our code that checks to see if our customer is up to date on their payments. We will put that functionality into an object and we'll give that object a name like Check Payments, or Check Balance. Now that object can then be what's called instantiated, OK, or created in memory. This can happen multiple times so that one object that we created can be made copies in memory, so we can have six copies of this object in memory and all six of those copies are totally free from each other. There are six totally separate states, if you will and they have different properties and so forth. Now, the objects mimic real life entities and actions. Now in one of my other courses, I don't know if it was the C# or the Visual Studio, I used the example of a veterinarian's office and if you were going to build code for a veterinarian's office think about what a veterinarian does. Well, people bring in animals, so we'd have an Animal Class. They bring in dogs. Well, that's part of the animal so we would inherit from the Animal Class and we would write anything that we have to do to a dog. Then a Cat Class, anything we do to a cat, Snakes, anything we do to snakes for those people who have snakes for pets, figure that out. But we're going to mimic real life and we're going to put those actions in and we're only going to write those actions one time and then we'll just use objects created from those main classes. Now what I want to do is give you a quick little diagram here and I'll kind of step through this and show you a couple of things as we go. Now first up, we are going to create what's called a class. These are these real world objects. Let's say in our veterinary course and our veterinary program, we're going to create a Class called Animal because everybody's going to bring an animal in here and we're going to have to have the animal's name, their weight, the breed, everything about this animal and we're going to write it into our database. And so, think about as this program's running we could have four people up front on the counter checking animals in, right? We've got a booming veterinary clinic here. Well, the way to do this, number one is to write that code one time, right here in this Class. And now what we're going to do is we're going to create a copy of this class out in memory - let me take that off just a second - we're going to instantiate a copy. Now this is out here in memory. This is supposed to be a cloud right here in memory. Now, I can create this and in Visual Basic this is where you'll say dmx equals new animal if this Class here was called animal. That puts a copy of this Class in memory and we can now set the properties. We can set the name to Spot, the breed to Collie, or the weight to however many pounds Collies weigh and all that kind of stuff. Then we can write that into a database. Now at the same time we can also create another object and this is a second animal and we'll call this one Object B, or maybe this guy's name is Spike and so we set the name to Spike on this guy, but this is Spike right here and we set Spike's breed, he's a Pit Bull and we set his weight and then we can write that information about Spike into the database. Now, as soon as we're through with one of these objects in memory we can just simply drop it from memory and then we can create another object, put a name, address, phone number, you know, owner's name, weight, breed, all that stuff, write it into the database. Now that is, in a nutshell, a very simplistic look at Object Oriented Development and if you'll think about every aspect of that program - we do billing, so we would write a billing Class, right? And, we would build a billing Class right here to handle all of our billing functions. Now notice what happens. Whenever we need to change the billing function on our program we just come and change the code right here in our billing Class and the next time the application runs anybody who instantiates an object from this class gets that functionality. Now, I'm obviously just scratching the surface on Object Oriented Development so you may want to go out and read some about this and play with it, but you will hear some different things about Classes and Events and methods and properties and so forth as we go through this course and I just wanted to tip you off on what everything is. Again, it's not an object oriented or a programming class but I don't want to lose you on terminology here.
Tutorial Information
| Course: | Microsoft ASP.NET 3.5 |
| Author: | Mark Long |
| SKU: | 34102 |
| ISBN: | 1-93633412-7 |
| Release Date: | 2010-03-24 |
| Duration: | 6 hrs / 69 lessons |
| Work Files: |
Yes |
| Captions: | Available on CD and Online University |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 