🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Topic 1.3 Defining Object Model_ CS 002-CS21S1 - Advanced Object-Oriented Programming.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

 CS 002-CS21S1 - Advanc… Pages Topic 1.3 Defining Object Model Immersive Reader First Semester SY 2024-2025 (… Account Home Syllabus Topi...

 CS 002-CS21S1 - Advanc… Pages Topic 1.3 Defining Object Model Immersive Reader First Semester SY 2024-2025 (… Account Home Syllabus Topic 1.3 Defining Object Model Dashboard Modules Courses Discussions Module 1 - Topic 3: Defining Object Model Assignments Groups Quizzes In order to create a model for an object, we must define its 2 major components. Chat 1. A ributes or State Calendar BigBlueBu on 2. Behavior 44 People A ributes or State Inbox Grades 2 It describes the current characteris cs of the specified. Take note of the word keyword current, this means that Collabora ons the a ributes may change over me. History Behavior Help These are the possible ac ons that your object is able to do. Some ac ons might change the its own state or other's state. Some might tell us about its state. Some might be able to do both things. Example 1: Light Bulb A ributes or State 1. is powered - indicates whether the bulb is "on" or "off" 2. color - color emmited by the buld 3. wa s - number represen ng the power required to power the bulb Behavior 1. turn on - powers the light bulb on 2. turn off - powers down the light bulb 3. flip switch - toggles the power for the bulb 4. check status - tells the current power status of the bulb 5. check color - tells the color of the bulb 6. check wa s - tells how much power is needed to power the bulb Example 2: Bank Account A ributes or State 1. account number - iden fies the owner of the account 2. balance - amount of money stored in the account Behavior 1. deposit - insert more money into the bank account 2. withdraw - retrieve money from the account 3. inquire balance - check how much money is le on the account Notes Objects are considered as ANTHROPOMORPHIC Each object is smart or expert enough for its own task. However, they are not able to move on their own. It needs commands coming from another object to perform their exper se. Let us take the bulb as an example. The light bulb will never turn on or off on its own. It needs somebody to do it. So objects need to communicate to one another for a program in Java to work. Each object represent an ABSTRACTION. We can think of objects as a black box. The specific details are hidden and only general details are visible. This process can lessen the complexity of programming since the object features are defined separately. Discussion Please click the link to par cipate: Discussion 1.2 Defining Object Model Home Page Back to Top Previous Next

Use Quizgecko on...
Browser
Browser