Rather than them each having their own set of attributes and behaviors, static or shared members of objects in a class share attributes, variables, and behaviors. Follow along with this online programming tutorial to learn about the step-by-step processes and guidelines for using static or shared members on all objects in a class.
Up 'til now we've been focused on the instance members of our classes where…every object we instantiate will have its own unique copy of all the attributes…and all the behaviors we've defined.…But we can also create what are called static or shared members, meaning a…variable or a method that is shared across all objects in that class. Here's an example.…So I have a straightforward SavingsAccount class with an accountNumber…attribute, and a balance attribute, deposit and withdraw methods.…
And we can instantiate multiple objects based on this class that all have their…own copies of all the attributes and behaviors, the variables and methods.…But then we realize they all need an interest rate, and that's a pretty…straightforward piece of information, and it belongs here.…Should savings account have an interested rate? Sure, it should.…So we could define that as a regular attribute, an instance variable, and now…every instance, every object has its own copy of interest rate.…But our business rules say that interest rate is one rate across all savings…
Let Simon Allardice introduce you to the terms—words like abstraction, inheritance, polymorphism, subclass—and guide you through defining your requirements and identifying use cases for your program. The course also covers creating conceptual models of your program with design patterns, class and sequence diagrams, and unified modeling language (UML) tools, and then shows how to convert the diagrams into code.
- Why use object-oriented design (OOD)?
- Pinpointing use cases, actors, and scenarios
- Identifying class responsibilities and relationships
- Creating class diagrams
- Using abstract classes
- Working with inheritance
- Creating advanced UML diagrams
- Understanding object-oriented design principles
Skill Level Intermediate
1. Core Concepts
2. Object-Oriented Analysis and Design
Defining requirements6m 9s
3. Utilizing Use Cases
4. Domain Modeling (Modeling the App)
5. Creating Classes
6. Inheritance and Composition
7. Advanced Concepts
8. Object-Oriented Design Patterns
9. Object-Oriented Design Principles
- Mark as unwatched
- Mark all as unwatched
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.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.