Easy-to-follow video tutorials help you learn software, creative, and business skills.Become a member

What is an object?

From: Foundations of Programming: Object-Oriented Design

Video: What is an object?

Always remember that Object-Orientation and computing was intended to make thinking about programming closer to thinking about the real world. And that means if we ask what is an object in a computer program, we first ask what is an object in the real world? Well, we instinctively know what that means, but it's tough to describe without saying something vague like an object is a thing. So is this apple an object in real life? Sure. This desk? Well, of course. This mug? Absolutely! They are all objects, these are all things.

What is an object?

Always remember that Object-Orientation and computing was intended to make thinking about programming closer to thinking about the real world. And that means if we ask what is an object in a computer program, we first ask what is an object in the real world? Well, we instinctively know what that means, but it's tough to describe without saying something vague like an object is a thing. So is this apple an object in real life? Sure. This desk? Well, of course. This mug? Absolutely! They are all objects, these are all things.

We understand that objects are separate from one another. They have their own existence, their own identity that is independent of other objects. This is a mug, and this is a mug, but they are not the same mug, they are not the same object. They are different objects, they have their own identity. We know that being an object has nothing to do with complexity. An apple is an object, but so is an aircraft carrier, so as an iPhone, and we know that one object might contain other objects.

But we still understand their separateness, this does not confuse us. We know that objects have characteristics, inherent properties that describe them. A mug can be full or empty. An apple can be green or red, a lamp can be off or on. These are the attributes of any object, things like color, weight, and size. They describe the current state of an object and the state of one object is independent of another. We turn one lamp off, it does not turn all the lamps in the world off.

And most objects have multiple attributes. A mug can be full or empty or somewhere in between but at the same time it could be black or white or some other color. It could be large or small and in the real world objects have behavior, a telephone can ring, an airplane can fly, and that behavior is specific to the type of object. An apple does not ring, a telephone does not fly. But those three things, identity, attributes, and behavior are the same three things that describe an object in an object-oriented programming language.

Objects in a computer program are self-contained. So they have identity separate from other objects. They also have their own attributes. Information that describes their current state, and they have their own behavior, things they can do. Now while in the real world we tend to only use the word object for things we can see and touch, but in computing we can take it further. Sure, in a computer program, we often have objects that represent real world items like car, house, apple, but also a date could be an object, a time, a bank account could be an object, and you can't touch and hold a bank account in real life.

But it is still a well-defined idea, and even in real life it meets our definition of object. It has identity. One bank account is separate from another bank account. It has attributes or data that describe its current state. An account number, a balance, an account holder name, and it has behavior. You can deposit to a bank account, you can withdraw from it, you can open it or close it. And just as they don't have to be physical items, objects in a computer program are not just the things with a visual appearance on the computer screen.

Sure, buttons and images and spaceships can all be objects, but so could invisible things like a timer or an array. So we don't just focus purely on a physical items or visible items when you are working with objects in a computer program. Now when you're new to Object-Oriented Design, it can be a bit of a challenge to figure out if something in your application is a new potential object. It's easy when your application needs something like car, employee, document, but say you're building an event management application.

Well, what about something like event? Would an event be an object? Well, first, one clue is is the word a noun? Nouns aren't just physical things, but people, places, and ideas or concepts. But if you don't want to do that, here's even a simpler suggestion. If you were talking about any conversation, could you put the word "the" in front of it? The mug, the apple, the car, the television, sure, but also the bank account, the time, the date, the event. Those work too.

Those could be objects. But you wouldn't say the saving, the printing, the exploding. Those would be verbs. They would be behaviors of objects, not objects themselves. But where do these objects come from? They don't magically appear in our program, so how do we make them? Well, to do that, there is another word we must explore that goes hand in hand with object, and that word is class.

Show transcript

This video is part of

Image for Foundations of Programming: Object-Oriented Design
Foundations of Programming: Object-Oriented Design

47 video lessons · 48090 viewers

Simon Allardice
Author

 
Expand all | Collapse all
  1. 11m 35s
    1. Welcome
      1m 25s
    2. Who this course is for
      1m 15s
    3. What to expect from this course
      3m 6s
    4. Exploring object-oriented analysis, design, and development
      1m 41s
    5. Reviewing software development methodologies
      4m 8s
  2. 26m 14s
    1. Why we use object-orientation
      2m 42s
    2. What is an object?
      5m 22s
    3. What is a class?
      4m 43s
    4. What is abstraction?
      2m 45s
    5. What is encapsulation?
      3m 45s
    6. What is inheritance?
      3m 35s
    7. What is polymorphism?
      3m 22s
  3. 12m 16s
    1. Understanding the object-oriented analysis and design processes
      4m 13s
    2. Defining requirements
      6m 9s
    3. Introduction to the Unified Modeling Language (UML)
      1m 54s
  4. 23m 35s
    1. Understanding use cases
      6m 11s
    2. Identifying the actors
      4m 16s
    3. Identifying the scenarios
      5m 7s
    4. Diagramming use cases
      4m 18s
    5. Employing user stories
      3m 43s
  5. 16m 36s
    1. Creating a conceptual model
      1m 59s
    2. Identifying the classes
      2m 27s
    3. Identifying class relationships
      2m 38s
    4. Identifying class responsibilities
      6m 43s
    5. Using CRC cards
      2m 49s
  6. 22m 25s
    1. Creating class diagrams
      6m 11s
    2. Converting class diagrams to code
      4m 57s
    3. Exploring object lifetime
      5m 55s
    4. Using static or shared members
      5m 22s
  7. 19m 49s
    1. Identifying inheritance situations
      6m 49s
    2. Using inheritance
      2m 43s
    3. Using abstract classes
      2m 2s
    4. Using interfaces
      4m 20s
    5. Using aggregation and composition
      3m 55s
  8. 9m 23s
    1. Creating sequence diagrams
      5m 18s
    2. Working with advanced UML diagrams
      2m 3s
    3. Using UML tools
      2m 2s
  9. 10m 39s
    1. Introduction to design patterns
      2m 40s
    2. Example: the singleton pattern
      4m 53s
    3. Example: the memento pattern
      3m 6s
  10. 21m 47s
    1. Introduction to object-oriented design principles
      2m 50s
    2. Exploring general development principles
      3m 55s
    3. Introduction to SOLID principles
      6m 43s
    4. Introduction to GRASP principles
      8m 19s
  11. 7m 1s
    1. Reviewing feature support across different object-oriented languages
      3m 50s
    2. Additional resources
      2m 27s
    3. Goodbye
      44s

Start learning today

Get unlimited access to all courses for just $25/month.

Become a member
Sometimes @lynda teaches me how to use a program and sometimes Lynda.com changes my life forever. @JosefShutter
@lynda lynda.com is an absolute life saver when it comes to learning todays software. Definitely recommend it! #higherlearning @Michael_Caraway
@lynda The best thing online! Your database of courses is great! To the mark and very helpful. Thanks! @ru22more
Got to create something yesterday I never thought I could do. #thanks @lynda @Ngventurella
I really do love @lynda as a learning platform. Never stop learning and developing, it’s probably our greatest gift as a species! @soundslikedavid
@lynda just subscribed to lynda.com all I can say its brilliant join now trust me @ButchSamurai
@lynda is an awesome resource. The membership is priceless if you take advantage of it. @diabetic_techie
One of the best decision I made this year. Buy a 1yr subscription to @lynda @cybercaptive
guys lynda.com (@lynda) is the best. So far I’ve learned Java, principles of OO programming, and now learning about MS project @lucasmitchell
Signed back up to @lynda dot com. I’ve missed it!! Proper geeking out right now! #timetolearn #geek @JayGodbold
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Foundations of Programming: Object-Oriented Design.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.