SlideShare uma empresa Scribd logo
1 de 15
Designing Classes

1.   Designing classes
2.   Designing protocols and class visibility
3.   The UML object Constraint language
4.   Designing methods
Introduction
• Designer has to know
  – Specification of the class
  – interaction of that class with other classes
Object oriented design philosophy
• Designing class with reusability in mind ->
  more gain in productivity and reduce the time
  for developing new application
UML Object Constraint Language(OCL)
•   The rules and semantics of UML are expressed using OCL
•   OCL
     – Specification language
     – Uses simple logic to specify the properties of the system
•   UML modeling constructs requires expression. some example as follow
     – Item.selector
         • Item -> object
         • Selector -> attribute
         • Ex : kathir.regno
     – Item.selextor[qualifier-value]
         • Qualifier is uesd to select related values
         • Ex:
               – Kathir.phone[2]
     – Set->select ( Boolean expression)
         • Company.employee->salary>20000
Designing classes : process
• Apply design axioms to design calsses , their
  atribute, methods and association , structures,
  amd protocols
  – Refine and complete the static uml class diagrams by
    adding details to that design
     • Refine attribute
     • Design methods and protocols
         – Uses uml activity diagram to represent algorithm
     • Refine the association bw classes
     • Refine class hierarchy and design with inheritance
  – Iterate and refine
Class visibility: desiging well defined
    public , private and protected
                 protocols
• 2 problems in designing methods or attributes
  of class
  – Protocol or interface to the class operation and
    its visibility
  – How it is implemented
• Protocol layers
  – Private protocol
  – Protected protocol
  – Public protocol
Internal layer
• Defines the implementation of the object
• Apply axioms and corollaries ( corollary 1) to
  decide what to private
• Private protocol
   – Includes messages that should not be sent from other
     objects
   – Accessible to only operations of that class
• Protected protocol
   – Methods and attributes can be used by class itself or
     its subclass
External layer
• Design the functionality of the object
• Public protocol
  – Defined to pass message bw associated classes
  – Interpretation and implementation of each
    message is up to the individual classes
Encapsulation leakage

• lack of well designed protocol leads to this
  problem
• Encapsulation leakage occurs when details
  about classes internal implementation are
  disclosed through the interface
Refining attribute
• Attribute
   – Represents the state of the object
• Analysis phase -> name of the attribute is sufficient
• Design phase         -> detailed information must
  be added
• Attribute types
   – Single valued attribute
      • Ex: dob of the student
   – Multiplicity or multivalue attribute
      • Subjects handled by the staff
   – Reference to another object or instance connection
      • Person hold the account
UML attribute presentation
• OCL is used in the design phase to define the
  class attributes
• Attribute presentation
  – Visibility name : type-expression = initial-value
  – Visibility
     • Public visibility      :     +
     • Protected visibility   :     #
     • Private visibility     :     -
  – Type expression
     • Language dependent specification of the type
  – Initial value
     • Language dependent expression for the initial value
Designing methods and protocols
• Specifying the algorithm for methods
  – By using formal structure (ex uml activity diag) with
    OCL
• Types of methods
  –   Constructor
  –   Destructor
  –   Conversion method
  –   Copy method
  –   Attribute set
  –   Attribute get
  –   IO methods
  –   Domain specific
Design issues : avoiding pitfalls
• Better to have Large set of simple classes than
  few large , complex classes
  – Initially class might be too big
  – Apply design axioms and corollary
     • to reduce the size
     • Improve reusability
UML Operation presentation
• Visibility name: (Parameter list ) : return-type-expression
   – Visibility
       • Public visibility           :          +
       • Protected visibility        :          #
       • Private visibility          :          -
   – Name
       • Name of the operation
   – Parameter list
       • List of parameters each specified by
           – Name : type expression = default value
   – Return type expression
   – Ex:
       • + withdraw(amount:type):
Packaging and managing classes

Mais conteúdo relacionado

Mais procurados

Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementationthe_wumberlog
 
OOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and ObjectOOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and Objectdkpawar
 
Local variables Instance variables Class/static variables
Local variables Instance variables Class/static variablesLocal variables Instance variables Class/static variables
Local variables Instance variables Class/static variablesSohanur63
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and InterfaceHaris Bin Zahid
 
Oop(object oriented programming)
Oop(object oriented programming)Oop(object oriented programming)
Oop(object oriented programming)geetika goyal
 
OOPS – General Understanding in .NET
OOPS – General Understanding in .NETOOPS – General Understanding in .NET
OOPS – General Understanding in .NETSabith Byari
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingPurvik Rana
 
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Simplilearn
 
Basics of Object Oriented Programming
Basics of Object Oriented ProgrammingBasics of Object Oriented Programming
Basics of Object Oriented ProgrammingAbhilash Nair
 

Mais procurados (18)

Lecture 1 uml with java implementation
Lecture 1 uml with java implementationLecture 1 uml with java implementation
Lecture 1 uml with java implementation
 
OOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and ObjectOOP Unit 2 - Classes and Object
OOP Unit 2 - Classes and Object
 
Local variables Instance variables Class/static variables
Local variables Instance variables Class/static variablesLocal variables Instance variables Class/static variables
Local variables Instance variables Class/static variables
 
Abstract class and Interface
Abstract class and InterfaceAbstract class and Interface
Abstract class and Interface
 
Unit 4
Unit 4Unit 4
Unit 4
 
Oop(object oriented programming)
Oop(object oriented programming)Oop(object oriented programming)
Oop(object oriented programming)
 
Object oriented programming With C#
Object oriented programming With C#Object oriented programming With C#
Object oriented programming With C#
 
OOPS – General Understanding in .NET
OOPS – General Understanding in .NETOOPS – General Understanding in .NET
OOPS – General Understanding in .NET
 
Unit 4 plsql
Unit 4  plsqlUnit 4  plsql
Unit 4 plsql
 
2. Basics of Java
2. Basics of Java2. Basics of Java
2. Basics of Java
 
OOPs Concepts - Android Programming
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
 
[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP[OOP - Lec 01] Introduction to OOP
[OOP - Lec 01] Introduction to OOP
 
Ch5 inheritance
Ch5 inheritanceCh5 inheritance
Ch5 inheritance
 
Better Understanding OOP using C#
Better Understanding OOP using C#Better Understanding OOP using C#
Better Understanding OOP using C#
 
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
Abstract Class In Java | Java Abstract Class Tutorial | Java Tutorial For Beg...
 
inheritance
inheritanceinheritance
inheritance
 
Metaprogramming ruby
Metaprogramming rubyMetaprogramming ruby
Metaprogramming ruby
 
Basics of Object Oriented Programming
Basics of Object Oriented ProgrammingBasics of Object Oriented Programming
Basics of Object Oriented Programming
 

Semelhante a Unit 4 designing classes (20)

c++ Unit I.pptx
c++ Unit I.pptxc++ Unit I.pptx
c++ Unit I.pptx
 
8 oo approach&uml-23_feb
8 oo approach&uml-23_feb8 oo approach&uml-23_feb
8 oo approach&uml-23_feb
 
General oop concept
General oop conceptGeneral oop concept
General oop concept
 
Data abstraction and object orientation
Data abstraction and object orientationData abstraction and object orientation
Data abstraction and object orientation
 
Design patterns-sav
Design patterns-savDesign patterns-sav
Design patterns-sav
 
C++ppt. Classs and object, class and object
C++ppt. Classs and object, class and objectC++ppt. Classs and object, class and object
C++ppt. Classs and object, class and object
 
CS1Lesson13-IntroClasses.pptx
CS1Lesson13-IntroClasses.pptxCS1Lesson13-IntroClasses.pptx
CS1Lesson13-IntroClasses.pptx
 
Oracle forms les23
Oracle forms  les23Oracle forms  les23
Oracle forms les23
 
Object-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & ProgrammingObject-oriented Analysis, Design & Programming
Object-oriented Analysis, Design & Programming
 
1unit-120324103142-phpapp02.pdf
1unit-120324103142-phpapp02.pdf1unit-120324103142-phpapp02.pdf
1unit-120324103142-phpapp02.pdf
 
OMTanalysis.ppt
OMTanalysis.pptOMTanalysis.ppt
OMTanalysis.ppt
 
OMTanalysis.ppt
OMTanalysis.pptOMTanalysis.ppt
OMTanalysis.ppt
 
c++ Unit III - PPT.pptx
c++ Unit III - PPT.pptxc++ Unit III - PPT.pptx
c++ Unit III - PPT.pptx
 
1 unit (oops)
1 unit (oops)1 unit (oops)
1 unit (oops)
 
Design Patterns - GOF
Design Patterns - GOFDesign Patterns - GOF
Design Patterns - GOF
 
m211c25.ppt
m211c25.pptm211c25.ppt
m211c25.ppt
 
Analysis
AnalysisAnalysis
Analysis
 
ITSE_10(UML,OO).pptx
ITSE_10(UML,OO).pptxITSE_10(UML,OO).pptx
ITSE_10(UML,OO).pptx
 
03 classes interfaces_principlesofoop
03 classes interfaces_principlesofoop03 classes interfaces_principlesofoop
03 classes interfaces_principlesofoop
 
Introducing object oriented programming (oop)
Introducing object oriented programming (oop)Introducing object oriented programming (oop)
Introducing object oriented programming (oop)
 

Mais de gopal10scs185 (20)

Os5
Os5Os5
Os5
 
Os4
Os4Os4
Os4
 
Os1
Os1Os1
Os1
 
Os8
Os8Os8
Os8
 
Os8
Os8Os8
Os8
 
Os7
Os7Os7
Os7
 
Os6
Os6Os6
Os6
 
Os4
Os4Os4
Os4
 
Os3
Os3Os3
Os3
 
Os2
Os2Os2
Os2
 
Unit4 desiging classes
Unit4 desiging classesUnit4 desiging classes
Unit4 desiging classes
 
Unit three identifying actors
Unit three  identifying actorsUnit three  identifying actors
Unit three identifying actors
 
Unit 5 testing
Unit 5 testingUnit 5 testing
Unit 5 testing
 
Unit 5
Unit 5Unit 5
Unit 5
 
Unit 5 usability and satisfaction test
Unit 5 usability and satisfaction testUnit 5 usability and satisfaction test
Unit 5 usability and satisfaction test
 
Unit 5 testing -software quality assurance
Unit 5  testing -software quality assuranceUnit 5  testing -software quality assurance
Unit 5 testing -software quality assurance
 
Unit 4
Unit 4Unit 4
Unit 4
 
Unit 3 object analysis-classification
Unit 3 object analysis-classificationUnit 3 object analysis-classification
Unit 3 object analysis-classification
 
Unit 3 attributes, methods, relationships
Unit 3 attributes, methods, relationshipsUnit 3 attributes, methods, relationships
Unit 3 attributes, methods, relationships
 
Unit 3
Unit 3Unit 3
Unit 3
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Último (20)

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Unit 4 designing classes

  • 1. Designing Classes 1. Designing classes 2. Designing protocols and class visibility 3. The UML object Constraint language 4. Designing methods
  • 2. Introduction • Designer has to know – Specification of the class – interaction of that class with other classes
  • 3. Object oriented design philosophy • Designing class with reusability in mind -> more gain in productivity and reduce the time for developing new application
  • 4. UML Object Constraint Language(OCL) • The rules and semantics of UML are expressed using OCL • OCL – Specification language – Uses simple logic to specify the properties of the system • UML modeling constructs requires expression. some example as follow – Item.selector • Item -> object • Selector -> attribute • Ex : kathir.regno – Item.selextor[qualifier-value] • Qualifier is uesd to select related values • Ex: – Kathir.phone[2] – Set->select ( Boolean expression) • Company.employee->salary>20000
  • 5. Designing classes : process • Apply design axioms to design calsses , their atribute, methods and association , structures, amd protocols – Refine and complete the static uml class diagrams by adding details to that design • Refine attribute • Design methods and protocols – Uses uml activity diagram to represent algorithm • Refine the association bw classes • Refine class hierarchy and design with inheritance – Iterate and refine
  • 6. Class visibility: desiging well defined public , private and protected protocols • 2 problems in designing methods or attributes of class – Protocol or interface to the class operation and its visibility – How it is implemented • Protocol layers – Private protocol – Protected protocol – Public protocol
  • 7. Internal layer • Defines the implementation of the object • Apply axioms and corollaries ( corollary 1) to decide what to private • Private protocol – Includes messages that should not be sent from other objects – Accessible to only operations of that class • Protected protocol – Methods and attributes can be used by class itself or its subclass
  • 8. External layer • Design the functionality of the object • Public protocol – Defined to pass message bw associated classes – Interpretation and implementation of each message is up to the individual classes
  • 9. Encapsulation leakage • lack of well designed protocol leads to this problem • Encapsulation leakage occurs when details about classes internal implementation are disclosed through the interface
  • 10. Refining attribute • Attribute – Represents the state of the object • Analysis phase -> name of the attribute is sufficient • Design phase -> detailed information must be added • Attribute types – Single valued attribute • Ex: dob of the student – Multiplicity or multivalue attribute • Subjects handled by the staff – Reference to another object or instance connection • Person hold the account
  • 11. UML attribute presentation • OCL is used in the design phase to define the class attributes • Attribute presentation – Visibility name : type-expression = initial-value – Visibility • Public visibility : + • Protected visibility : # • Private visibility : - – Type expression • Language dependent specification of the type – Initial value • Language dependent expression for the initial value
  • 12. Designing methods and protocols • Specifying the algorithm for methods – By using formal structure (ex uml activity diag) with OCL • Types of methods – Constructor – Destructor – Conversion method – Copy method – Attribute set – Attribute get – IO methods – Domain specific
  • 13. Design issues : avoiding pitfalls • Better to have Large set of simple classes than few large , complex classes – Initially class might be too big – Apply design axioms and corollary • to reduce the size • Improve reusability
  • 14. UML Operation presentation • Visibility name: (Parameter list ) : return-type-expression – Visibility • Public visibility : + • Protected visibility : # • Private visibility : - – Name • Name of the operation – Parameter list • List of parameters each specified by – Name : type expression = default value – Return type expression – Ex: • + withdraw(amount:type):