際際滷

際際滷Share a Scribd company logo
2
Lecture Outline
 Introduction
 Object-Oriented Style
 Reusability
 Extensibility
 Robustness
 Programming-in-the-large
Most read
5
Reusability
 Kind of reusability
 Sharing of newly-written code within a project
 Reuse of previously-written code on new projects
 Style rules for reusability
 Keep methods coherent
 Keep methods small
 Keep methods consistent
 Separate policy and implementation
 Provide uniform coverage
 Broaden the method as much as possible
 Avoid global information
 Avoid modes
Most read
Programming Style
Chapter 14
Part 3: Implementation
Object-Oriented Modeling and Design
Byung-Hyun Ha
bhha@pusan.ac.kr
Sumber dari: ike.ie.pusan.ac.kr/w/images/c/cc/08sal_ch014.ppt
Lecture Outline
 Introduction
 Object-Oriented Style
 Reusability
 Extensibility
 Robustness
 Programming-in-the-large
Introduction
 The experienced programmer follows principles to
make readable programs that live beyond the
immediate need
 Good style is important in all programming, but it is
even more important in OO design and programming
because much of the benefit of the OO approach is
predicated on producing reusable, extensible,
understandable programs
Object-Oriented Style
 Reusability
 Extensibility
 Robustness
 Programming-in-the-large
Reusability
 Kind of reusability
 Sharing of newly-written code within a project
 Reuse of previously-written code on new projects
 Style rules for reusability
 Keep methods coherent
 Keep methods small
 Keep methods consistent
 Separate policy and implementation
 Provide uniform coverage
 Broaden the method as much as possible
 Avoid global information
 Avoid modes
Reusability
 Using inheritance
 Subroutines
 Factoring
 Delegation
 Encapsulate external code
Extensibility
 OO principles for extensibility
 Encapsulate classes
 Hide data structures
 Avoid traversing multiple links or methods
 Avoid cast statements on object type
 Distinguish public and private operations
Robustness
 Guidelines for robustness
 Protect against errors
 User errors and low-level system errors
 Programming bugs
 Optimize after the program runs
 Validate arguments
 Avoid predefined limits
 Instrument the program for debugging and performance
monitoring
Programming-in-the-large
 Guidelines
 Do not prematurely begin programming
 Keep method understandable
 Make methods readable
 Use exactly the same names as in the object model
 Choose name carefully
 Use programming guidelines
 Package into modules
 Document classes and methods
 Publish the specification
Appendix: OO and Programming
 We already discussed
 Farm
 toString() and priority queue
 Window programming
 They cannot be possible without inheritance and
polymorphism
 If you want to prepare those functionalities in the examples, you
should consider the use of OO concepts
 Otherwise, your program will never be understandable (even for
yourself), extensible, and reusable
Appendix: OO and Programming
 Inventory example
 Inventory simulation
 Assumptions
 Two types of suppliers
 Three types of demands
 Two types of policies
 Two ways of displaying results
 If you want to carry out simulation for every possible combination
of settings, you have to write 24 (= 2x3x2x2) programs
 Too complex to write and manage
 Lets make them using one program (Inv_manage1.java)
 How about it?
 Could you understand?
 Do you think you can easily extend the program?
Appendix: OO and Programming
 Inventory example (cont)
 Lets use OO concepts (Inv_manage2.java, )
 First of all, easy to understand
 Coherent, small, clear, consistent, extendible, reusable, 
Inv_manage
Supplier Demand Policy Display
put_order
today_deliever
today_demand today_order show
Appendix: OO and Programming
 Tree example
 Tree traversal with different purposes
 Structural way (Tree1.java)
 We should implement traversal algorithm every time we need
 OO way (Tree2.java)
 Dont care about how to traverse, only need to write what to do
4 5 6
2 3
1 2
5 7
1 32

More Related Content

What's hot (20)

ERP - Campus Management
ERP - Campus ManagementERP - Campus Management
ERP - Campus Management
Jaspal Singh
Unit 3(advanced state modeling & interaction meodelling)
Unit  3(advanced state modeling & interaction meodelling)Unit  3(advanced state modeling & interaction meodelling)
Unit 3(advanced state modeling & interaction meodelling)
Manoj Reddy
Cocomo model
Cocomo modelCocomo model
Cocomo model
Devan Thakur
Activity diagram
Activity diagramActivity diagram
Activity diagram
bhupendra kumar
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
Hassan A-j
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Sandeep Kumar Singh
Chapter 5 Software Design of software engineering.pptx
Chapter 5 Software Design of software engineering.pptxChapter 5 Software Design of software engineering.pptx
Chapter 5 Software Design of software engineering.pptx
gadisaAdamu
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system model
Harshad Umredkar
SAP- HCM mini project report on - Design Enterprise Structure in Personnel Ad...
SAP- HCM mini project report on - Design Enterprise Structure in Personnel Ad...SAP- HCM mini project report on - Design Enterprise Structure in Personnel Ad...
SAP- HCM mini project report on - Design Enterprise Structure in Personnel Ad...
Vijeth Karthik
Software Engineering Solved Past Paper 2020
Software Engineering Solved Past Paper 2020 Software Engineering Solved Past Paper 2020
Software Engineering Solved Past Paper 2020
MuhammadTalha436
Vb script
Vb scriptVb script
Vb script
mcatahir947
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
Ashesh R
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
Manish Kumar
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Mahesh Bhalerao
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types
Maitree Patel
Uml class-diagram
Uml class-diagramUml class-diagram
Uml class-diagram
ASHOK KUMAR PALAKI
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
Rahul Pola
Origins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTMLOrigins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTML
Howpk
File handling in c
File handling in cFile handling in c
File handling in c
David Livingston J
SDLC Models
SDLC ModelsSDLC Models
SDLC Models
akash250690
ERP - Campus Management
ERP - Campus ManagementERP - Campus Management
ERP - Campus Management
Jaspal Singh
Unit 3(advanced state modeling & interaction meodelling)
Unit  3(advanced state modeling & interaction meodelling)Unit  3(advanced state modeling & interaction meodelling)
Unit 3(advanced state modeling & interaction meodelling)
Manoj Reddy
Software Process Models
Software Process ModelsSoftware Process Models
Software Process Models
Hassan A-j
Chapter 5 Software Design of software engineering.pptx
Chapter 5 Software Design of software engineering.pptxChapter 5 Software Design of software engineering.pptx
Chapter 5 Software Design of software engineering.pptx
gadisaAdamu
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system model
Harshad Umredkar
SAP- HCM mini project report on - Design Enterprise Structure in Personnel Ad...
SAP- HCM mini project report on - Design Enterprise Structure in Personnel Ad...SAP- HCM mini project report on - Design Enterprise Structure in Personnel Ad...
SAP- HCM mini project report on - Design Enterprise Structure in Personnel Ad...
Vijeth Karthik
Software Engineering Solved Past Paper 2020
Software Engineering Solved Past Paper 2020 Software Engineering Solved Past Paper 2020
Software Engineering Solved Past Paper 2020
MuhammadTalha436
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
Ashesh R
Overview of UML Diagrams
Overview of UML DiagramsOverview of UML Diagrams
Overview of UML Diagrams
Manish Kumar
Object oriented analysis
Object oriented analysisObject oriented analysis
Object oriented analysis
Mahesh Bhalerao
Scheduling Definition, objectives and types
Scheduling Definition, objectives and types Scheduling Definition, objectives and types
Scheduling Definition, objectives and types
Maitree Patel
Sequence diagram
Sequence diagramSequence diagram
Sequence diagram
Rahul Pola
Origins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTMLOrigins and evolution of HTML and XHTML
Origins and evolution of HTML and XHTML
Howpk

Similar to Programing Style (20)

Object Oriented Programming in Swift Ch0 - Encapsulation
Object Oriented Programming in Swift Ch0 - EncapsulationObject Oriented Programming in Swift Ch0 - Encapsulation
Object Oriented Programming in Swift Ch0 - Encapsulation
Chihyang Li
Software Reuse and Object-Oriented Programming
Software Reuse and Object-Oriented ProgrammingSoftware Reuse and Object-Oriented Programming
Software Reuse and Object-Oriented Programming
kim.mens
Coding
CodingCoding
Coding
Vishal Singh
II BCA JAVA PROGRAMMING NOTES FOR FIVE UNITS.pdf
II BCA JAVA PROGRAMMING NOTES FOR FIVE UNITS.pdfII BCA JAVA PROGRAMMING NOTES FOR FIVE UNITS.pdf
II BCA JAVA PROGRAMMING NOTES FOR FIVE UNITS.pdf
rajeswaria21
Object Oriented Programming Part 2 of Unit 1
Object Oriented Programming Part 2 of Unit 1Object Oriented Programming Part 2 of Unit 1
Object Oriented Programming Part 2 of Unit 1
VigneshkumarPonnusam1
2.oop concept
2.oop concept2.oop concept
2.oop concept
Robbie AkaChopa
1. oop with c++ get 410 day 1
1. oop with c++ get 410   day 11. oop with c++ get 410   day 1
1. oop with c++ get 410 day 1
Mukul kumar Neal
Introduction.ppt JAVA SCRIPT PROGRAMMING AND
Introduction.ppt JAVA  SCRIPT PROGRAMMING ANDIntroduction.ppt JAVA  SCRIPT PROGRAMMING AND
Introduction.ppt JAVA SCRIPT PROGRAMMING AND
Jifarnecho
Unit1 jaava
Unit1 jaavaUnit1 jaava
Unit1 jaava
mrecedu
01-introductionto Object ooriented Programming in JAVA CS.ppt
01-introductionto Object ooriented Programming in JAVA CS.ppt01-introductionto Object ooriented Programming in JAVA CS.ppt
01-introductionto Object ooriented Programming in JAVA CS.ppt
GESISLAMIAPATTOKI
Networking chapter jkl; dfghyubLec 1.pptx
Networking chapter jkl; dfghyubLec 1.pptxNetworking chapter jkl; dfghyubLec 1.pptx
Networking chapter jkl; dfghyubLec 1.pptx
adnanshaheen425
Clean code
Clean codeClean code
Clean code
Simon S旦nnby
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
H端seyin Ergin
Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
ArifaMehreen1
ProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPSProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPS
sunmitraeducation
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programming
Jieyi Wu
Ooad presentation
Ooad presentationOoad presentation
Ooad presentation
Joel Corr棚a
Designing Object Oriented Software - lecture slides 2013
Designing Object Oriented Software - lecture slides 2013Designing Object Oriented Software - lecture slides 2013
Designing Object Oriented Software - lecture slides 2013
Jouni Smed
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
Zeeshan Khan
9-Coding.ppt
9-Coding.ppt9-Coding.ppt
9-Coding.ppt
KomalSinghGill
Object Oriented Programming in Swift Ch0 - Encapsulation
Object Oriented Programming in Swift Ch0 - EncapsulationObject Oriented Programming in Swift Ch0 - Encapsulation
Object Oriented Programming in Swift Ch0 - Encapsulation
Chihyang Li
Software Reuse and Object-Oriented Programming
Software Reuse and Object-Oriented ProgrammingSoftware Reuse and Object-Oriented Programming
Software Reuse and Object-Oriented Programming
kim.mens
II BCA JAVA PROGRAMMING NOTES FOR FIVE UNITS.pdf
II BCA JAVA PROGRAMMING NOTES FOR FIVE UNITS.pdfII BCA JAVA PROGRAMMING NOTES FOR FIVE UNITS.pdf
II BCA JAVA PROGRAMMING NOTES FOR FIVE UNITS.pdf
rajeswaria21
Object Oriented Programming Part 2 of Unit 1
Object Oriented Programming Part 2 of Unit 1Object Oriented Programming Part 2 of Unit 1
Object Oriented Programming Part 2 of Unit 1
VigneshkumarPonnusam1
1. oop with c++ get 410 day 1
1. oop with c++ get 410   day 11. oop with c++ get 410   day 1
1. oop with c++ get 410 day 1
Mukul kumar Neal
Introduction.ppt JAVA SCRIPT PROGRAMMING AND
Introduction.ppt JAVA  SCRIPT PROGRAMMING ANDIntroduction.ppt JAVA  SCRIPT PROGRAMMING AND
Introduction.ppt JAVA SCRIPT PROGRAMMING AND
Jifarnecho
Unit1 jaava
Unit1 jaavaUnit1 jaava
Unit1 jaava
mrecedu
01-introductionto Object ooriented Programming in JAVA CS.ppt
01-introductionto Object ooriented Programming in JAVA CS.ppt01-introductionto Object ooriented Programming in JAVA CS.ppt
01-introductionto Object ooriented Programming in JAVA CS.ppt
GESISLAMIAPATTOKI
Networking chapter jkl; dfghyubLec 1.pptx
Networking chapter jkl; dfghyubLec 1.pptxNetworking chapter jkl; dfghyubLec 1.pptx
Networking chapter jkl; dfghyubLec 1.pptx
adnanshaheen425
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
H端seyin Ergin
Software_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptxSoftware_Engineering_Presentation (1).pptx
Software_Engineering_Presentation (1).pptx
ArifaMehreen1
Object-oriented programming
Object-oriented programmingObject-oriented programming
Object-oriented programming
Jieyi Wu
Ooad presentation
Ooad presentationOoad presentation
Ooad presentation
Joel Corr棚a
Designing Object Oriented Software - lecture slides 2013
Designing Object Oriented Software - lecture slides 2013Designing Object Oriented Software - lecture slides 2013
Designing Object Oriented Software - lecture slides 2013
Jouni Smed

Recently uploaded (20)

How to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guidesHow to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guides
Celine George
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-30-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-30-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-30-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
What are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS MarketingWhat are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS Marketing
Celine George
Research Handbook On Environment And Investment Law Kate Miles
Research Handbook On Environment And Investment Law Kate MilesResearch Handbook On Environment And Investment Law Kate Miles
Research Handbook On Environment And Investment Law Kate Miles
mucomousamir
How to Manage Orders in Odoo 18 Lunch - Odoo 際際滷s
How to Manage Orders in Odoo 18 Lunch - Odoo 際際滷sHow to Manage Orders in Odoo 18 Lunch - Odoo 際際滷s
How to Manage Orders in Odoo 18 Lunch - Odoo 際際滷s
Celine George
Unit 4 Legal Issues in Reverse Engineering.pdf
Unit 4 Legal Issues in Reverse Engineering.pdfUnit 4 Legal Issues in Reverse Engineering.pdf
Unit 4 Legal Issues in Reverse Engineering.pdf
ChatanBawankar
How to Add a Custom Menu, List view and FIlters in the Customer Portal Odoo 18
How to Add a Custom Menu, List view and FIlters in the Customer Portal Odoo 18How to Add a Custom Menu, List view and FIlters in the Customer Portal Odoo 18
How to Add a Custom Menu, List view and FIlters in the Customer Portal Odoo 18
Celine George
Sri Guru Arjun Dev Ji .
Sri Guru Arjun Dev Ji                   .Sri Guru Arjun Dev Ji                   .
Sri Guru Arjun Dev Ji .
Balvir Singh
Policies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptxPolicies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptx
mansk2
How to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 ManufacturingHow to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 Manufacturing
Celine George
Odoo 18 Point of Sale PWA - Odoo 際際滷s
Odoo 18 Point of Sale PWA  - Odoo  際際滷sOdoo 18 Point of Sale PWA  - Odoo  際際滷s
Odoo 18 Point of Sale PWA - Odoo 際際滷s
Celine George
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptxQUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
Sourav Kr Podder
QUIZ-O-FORCE 3.0 FINAL SET BY SOURAV .pptx
QUIZ-O-FORCE 3.0 FINAL SET BY SOURAV .pptxQUIZ-O-FORCE 3.0 FINAL SET BY SOURAV .pptx
QUIZ-O-FORCE 3.0 FINAL SET BY SOURAV .pptx
Sourav Kr Podder
General Knowledge Quiz / Pub Quiz lvl 1.pptx
General Knowledge Quiz / Pub Quiz lvl 1.pptxGeneral Knowledge Quiz / Pub Quiz lvl 1.pptx
General Knowledge Quiz / Pub Quiz lvl 1.pptx
fxbktvnp8b
How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18
Celine George
LDMMIA Free Reiki Yoga S7 Weekly Workshops
LDMMIA Free Reiki Yoga S7 Weekly WorkshopsLDMMIA Free Reiki Yoga S7 Weekly Workshops
LDMMIA Free Reiki Yoga S7 Weekly Workshops
LDM & Mia eStudios
Uterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managmentUterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managment
Ritu480198
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh
How to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guidesHow to Setup Lunch in Odoo 18 - Odoo guides
How to Setup Lunch in Odoo 18 - Odoo guides
Celine George
A Brief Introduction About Jack Lutkus
A Brief Introduction About  Jack  LutkusA Brief Introduction About  Jack  Lutkus
A Brief Introduction About Jack Lutkus
Jack Lutkus
What are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS MarketingWhat are the Features & Functions of Odoo 18 SMS Marketing
What are the Features & Functions of Odoo 18 SMS Marketing
Celine George
Research Handbook On Environment And Investment Law Kate Miles
Research Handbook On Environment And Investment Law Kate MilesResearch Handbook On Environment And Investment Law Kate Miles
Research Handbook On Environment And Investment Law Kate Miles
mucomousamir
How to Manage Orders in Odoo 18 Lunch - Odoo 際際滷s
How to Manage Orders in Odoo 18 Lunch - Odoo 際際滷sHow to Manage Orders in Odoo 18 Lunch - Odoo 際際滷s
How to Manage Orders in Odoo 18 Lunch - Odoo 際際滷s
Celine George
Unit 4 Legal Issues in Reverse Engineering.pdf
Unit 4 Legal Issues in Reverse Engineering.pdfUnit 4 Legal Issues in Reverse Engineering.pdf
Unit 4 Legal Issues in Reverse Engineering.pdf
ChatanBawankar
How to Add a Custom Menu, List view and FIlters in the Customer Portal Odoo 18
How to Add a Custom Menu, List view and FIlters in the Customer Portal Odoo 18How to Add a Custom Menu, List view and FIlters in the Customer Portal Odoo 18
How to Add a Custom Menu, List view and FIlters in the Customer Portal Odoo 18
Celine George
Sri Guru Arjun Dev Ji .
Sri Guru Arjun Dev Ji                   .Sri Guru Arjun Dev Ji                   .
Sri Guru Arjun Dev Ji .
Balvir Singh
Policies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptxPolicies, procedures, subject selection and QTAC.pptx
Policies, procedures, subject selection and QTAC.pptx
mansk2
How to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 ManufacturingHow to Configure Subcontracting in Odoo 18 Manufacturing
How to Configure Subcontracting in Odoo 18 Manufacturing
Celine George
Odoo 18 Point of Sale PWA - Odoo 際際滷s
Odoo 18 Point of Sale PWA  - Odoo  際際滷sOdoo 18 Point of Sale PWA  - Odoo  際際滷s
Odoo 18 Point of Sale PWA - Odoo 際際滷s
Celine George
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptxQUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
QUIZ-O-FORCE FINAL SET BY SUDIPTA & SUBHAM.pptx
Sourav Kr Podder
QUIZ-O-FORCE 3.0 FINAL SET BY SOURAV .pptx
QUIZ-O-FORCE 3.0 FINAL SET BY SOURAV .pptxQUIZ-O-FORCE 3.0 FINAL SET BY SOURAV .pptx
QUIZ-O-FORCE 3.0 FINAL SET BY SOURAV .pptx
Sourav Kr Podder
General Knowledge Quiz / Pub Quiz lvl 1.pptx
General Knowledge Quiz / Pub Quiz lvl 1.pptxGeneral Knowledge Quiz / Pub Quiz lvl 1.pptx
General Knowledge Quiz / Pub Quiz lvl 1.pptx
fxbktvnp8b
How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18How to Setup Renewal of Subscription in Odoo 18
How to Setup Renewal of Subscription in Odoo 18
Celine George
LDMMIA Free Reiki Yoga S7 Weekly Workshops
LDMMIA Free Reiki Yoga S7 Weekly WorkshopsLDMMIA Free Reiki Yoga S7 Weekly Workshops
LDMMIA Free Reiki Yoga S7 Weekly Workshops
LDM & Mia eStudios
Uterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managmentUterine Prolapse, causes type and classification,its managment
Uterine Prolapse, causes type and classification,its managment
Ritu480198
LDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College VolumeLDMMIA About me 2025 Edition 3 College Volume
LDMMIA About me 2025 Edition 3 College Volume
LDM & Mia eStudios
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
"Orthoptera: Grasshoppers, Crickets, and Katydids pptx
Arshad Shaikh

Programing Style

  • 1. Programming Style Chapter 14 Part 3: Implementation Object-Oriented Modeling and Design Byung-Hyun Ha bhha@pusan.ac.kr Sumber dari: ike.ie.pusan.ac.kr/w/images/c/cc/08sal_ch014.ppt
  • 2. Lecture Outline Introduction Object-Oriented Style Reusability Extensibility Robustness Programming-in-the-large
  • 3. Introduction The experienced programmer follows principles to make readable programs that live beyond the immediate need Good style is important in all programming, but it is even more important in OO design and programming because much of the benefit of the OO approach is predicated on producing reusable, extensible, understandable programs
  • 4. Object-Oriented Style Reusability Extensibility Robustness Programming-in-the-large
  • 5. Reusability Kind of reusability Sharing of newly-written code within a project Reuse of previously-written code on new projects Style rules for reusability Keep methods coherent Keep methods small Keep methods consistent Separate policy and implementation Provide uniform coverage Broaden the method as much as possible Avoid global information Avoid modes
  • 6. Reusability Using inheritance Subroutines Factoring Delegation Encapsulate external code
  • 7. Extensibility OO principles for extensibility Encapsulate classes Hide data structures Avoid traversing multiple links or methods Avoid cast statements on object type Distinguish public and private operations
  • 8. Robustness Guidelines for robustness Protect against errors User errors and low-level system errors Programming bugs Optimize after the program runs Validate arguments Avoid predefined limits Instrument the program for debugging and performance monitoring
  • 9. Programming-in-the-large Guidelines Do not prematurely begin programming Keep method understandable Make methods readable Use exactly the same names as in the object model Choose name carefully Use programming guidelines Package into modules Document classes and methods Publish the specification
  • 10. Appendix: OO and Programming We already discussed Farm toString() and priority queue Window programming They cannot be possible without inheritance and polymorphism If you want to prepare those functionalities in the examples, you should consider the use of OO concepts Otherwise, your program will never be understandable (even for yourself), extensible, and reusable
  • 11. Appendix: OO and Programming Inventory example Inventory simulation Assumptions Two types of suppliers Three types of demands Two types of policies Two ways of displaying results If you want to carry out simulation for every possible combination of settings, you have to write 24 (= 2x3x2x2) programs Too complex to write and manage Lets make them using one program (Inv_manage1.java) How about it? Could you understand? Do you think you can easily extend the program?
  • 12. Appendix: OO and Programming Inventory example (cont) Lets use OO concepts (Inv_manage2.java, ) First of all, easy to understand Coherent, small, clear, consistent, extendible, reusable, Inv_manage Supplier Demand Policy Display put_order today_deliever today_demand today_order show
  • 13. Appendix: OO and Programming Tree example Tree traversal with different purposes Structural way (Tree1.java) We should implement traversal algorithm every time we need OO way (Tree2.java) Dont care about how to traverse, only need to write what to do 4 5 6 2 3 1 2 5 7 1 32