SlideShare a Scribd company logo
1 of 22
Download to read offline
Identify Symbol????
Tania &
Amar Present…
Package
Design
THIS CHAPTER IS ALL
ABOUT PACKAGE
DESIGN GUIDELINES
36.1. Package Organization
 Guideline #01:Package Functionally Cohesive
Vertical and Horizontal Slices.
• The basic "intuitive"principle is modularization based
on functional cohesiontypes (classes and
interfaces) are
grouped together that are strongly related in terms
of their participation in a commonpurpose, service,
collaborations, policy,and function.
Internal Relational cohesion
 RC=Number of Internal Relations / Number of Types
 Where NumberOfInternalRelationsincludes attribute
and parameter relations,inheritance, and interface
implementations between types in the package.
Types = Classe
Internal Relational cohesion
 A low RC value suggests:
 The package contains unrelated things and is not
factored well
 The package contains unrelated things and the
designer deliberatelydoes not care. This is common
with utility packages of disparate services (e.g.,
java.util),where high or low RC is not important.
 It contains one or more subset clusters with high RC,
but overall does not.
Guideline#02:Package a Family of
Interfaces
 Place a family of functionally related interfaces in a separate
package separate from implementation classes. The Java
technologies EJB package javax.ejb is an example: It is a
package of at least twelve interfaces;
implementations are in separate packages
Guideline#03:Package by Work
and by Clusters of Unstable
Classes
 packages are usually the basic unit of development
work and of release.
 Suppose 1) there is an existing large package P1
with thirty classes, and 2) there is a work trend that a
particular subset of ten classes (C1 through C10) is
regularly modifiedand re-released.
In this case, refactor P1 into P1-a and P1-b, where
P1-b contains the ten frequently worked on classes.
Guideline#04:More
Responsible are more stable
 Stable Package:
 Less dependent
 Abstract classes and interfaces
 Concrete and detailed code
 Unstable Package:
 More dependent
 Concrete, detailed
How to make a Package
Stable???
Package may become stable if…
 Package contains interfaces and abstract classes
 It has no dependency on other packages or only dependent
on stable packages
 It contains relatively stable code
Example: java.util
 It is mandated to have a slow change schedule
Example: java.lang
Guideline#05: Factor out
Independent Types
 Organize types(classes) that can be used
independently or in different classes into separate
packages.
 Keep above mentionedtypes into separate
packages
Guideline#06:Use Factories to
Reduce Dependency on
Concrete Packages
 Reduce dependency of a package to concrete
classes of other packages It will result in stability of
the package
How to achieve it?
By using a factory object that will return us objects
declared in terms of interfaces
Guideline #07: No cycles in
Package
 If group of packages have cyclicdependency,
then they may need to be treated as one large
package.
 It is undesirable.
So what to do to achieve
package stability???
 We have the solution
 Factor out the types
participating in the cycles into a
new smaller package
 Break the cycle with an interface
Steps to Break the cycle
 1. Redefine the depended-on classes in
one of the packages to implement new
interfaces.
 2.Define the new interfaces in a new package.
3. Redefine the dependent types to depend on the
interfaces in the new package, rather than the original
classes.
Ooad presentation package_design
Ooad presentation package_design

More Related Content

Viewers also liked (6)

Partes del gabinete jeyber qdocx
Partes del gabinete jeyber qdocxPartes del gabinete jeyber qdocx
Partes del gabinete jeyber qdocx
 
Sesión atención a la diversidad
Sesión atención a la diversidadSesión atención a la diversidad
Sesión atención a la diversidad
 
2b k y e [autoguardado]
2b k y e [autoguardado]2b k y e [autoguardado]
2b k y e [autoguardado]
 
Presentacion proyecto-tics
Presentacion proyecto-ticsPresentacion proyecto-tics
Presentacion proyecto-tics
 
Inspiring Behaviors = Success
Inspiring Behaviors = SuccessInspiring Behaviors = Success
Inspiring Behaviors = Success
 
Portada pedagogia
Portada  pedagogiaPortada  pedagogia
Portada pedagogia
 

Similar to Ooad presentation package_design

Principles of PHP Package Design (for AmsterdamPHP)
Principles of PHP Package Design (for AmsterdamPHP)Principles of PHP Package Design (for AmsterdamPHP)
Principles of PHP Package Design (for AmsterdamPHP)
Matthias Noback
 
chapter-3-interface-and-package.docx
chapter-3-interface-and-package.docxchapter-3-interface-and-package.docx
chapter-3-interface-and-package.docx
SupriyaNevewani
 

Similar to Ooad presentation package_design (20)

Principles of PHP Package Design (for AmsterdamPHP)
Principles of PHP Package Design (for AmsterdamPHP)Principles of PHP Package Design (for AmsterdamPHP)
Principles of PHP Package Design (for AmsterdamPHP)
 
Packages and Interfaces
Packages and InterfacesPackages and Interfaces
Packages and Interfaces
 
Software design principles - jinal desai
Software design principles - jinal desaiSoftware design principles - jinal desai
Software design principles - jinal desai
 
chapter-3-interface-and-package.docx
chapter-3-interface-and-package.docxchapter-3-interface-and-package.docx
chapter-3-interface-and-package.docx
 
Software Patterns
Software PatternsSoftware Patterns
Software Patterns
 
What are package managers?
What are package managers? What are package managers?
What are package managers?
 
Packages in java
Packages in javaPackages in java
Packages in java
 
Abap package concept
Abap package conceptAbap package concept
Abap package concept
 
Interfaces & Packages V2
Interfaces & Packages V2Interfaces & Packages V2
Interfaces & Packages V2
 
SAD05 - Encapsulation
SAD05 - EncapsulationSAD05 - Encapsulation
SAD05 - Encapsulation
 
Unit-4 Day1.pptx
Unit-4 Day1.pptxUnit-4 Day1.pptx
Unit-4 Day1.pptx
 
Soild principles
Soild principlesSoild principles
Soild principles
 
Domain model Refinement
Domain model RefinementDomain model Refinement
Domain model Refinement
 
uml reference package_diagram
uml reference package_diagramuml reference package_diagram
uml reference package_diagram
 
Solid Principles, for better cohesion and lower coupling
Solid Principles, for better cohesion and lower coupling Solid Principles, for better cohesion and lower coupling
Solid Principles, for better cohesion and lower coupling
 
Tool Driven Restructuring of Large Codebases
Tool Driven Restructuring of Large CodebasesTool Driven Restructuring of Large Codebases
Tool Driven Restructuring of Large Codebases
 
Sda 9
Sda   9Sda   9
Sda 9
 
Clean Code .Net Cheetsheets
Clean Code .Net CheetsheetsClean Code .Net Cheetsheets
Clean Code .Net Cheetsheets
 
Object Oriented Design SOLID Principles
Object Oriented Design SOLID PrinciplesObject Oriented Design SOLID Principles
Object Oriented Design SOLID Principles
 
Effective Software Design
Effective Software Design Effective Software Design
Effective Software Design
 

Recently uploaded

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 

Recently uploaded (20)

Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 

Ooad presentation package_design

  • 3. Package Design THIS CHAPTER IS ALL ABOUT PACKAGE DESIGN GUIDELINES
  • 4. 36.1. Package Organization  Guideline #01:Package Functionally Cohesive Vertical and Horizontal Slices. • The basic "intuitive"principle is modularization based on functional cohesiontypes (classes and interfaces) are grouped together that are strongly related in terms of their participation in a commonpurpose, service, collaborations, policy,and function.
  • 5. Internal Relational cohesion  RC=Number of Internal Relations / Number of Types  Where NumberOfInternalRelationsincludes attribute and parameter relations,inheritance, and interface implementations between types in the package. Types = Classe
  • 6. Internal Relational cohesion  A low RC value suggests:  The package contains unrelated things and is not factored well  The package contains unrelated things and the designer deliberatelydoes not care. This is common with utility packages of disparate services (e.g., java.util),where high or low RC is not important.  It contains one or more subset clusters with high RC, but overall does not.
  • 7. Guideline#02:Package a Family of Interfaces  Place a family of functionally related interfaces in a separate package separate from implementation classes. The Java technologies EJB package javax.ejb is an example: It is a package of at least twelve interfaces; implementations are in separate packages
  • 8. Guideline#03:Package by Work and by Clusters of Unstable Classes  packages are usually the basic unit of development work and of release.  Suppose 1) there is an existing large package P1 with thirty classes, and 2) there is a work trend that a particular subset of ten classes (C1 through C10) is regularly modifiedand re-released. In this case, refactor P1 into P1-a and P1-b, where P1-b contains the ten frequently worked on classes.
  • 9. Guideline#04:More Responsible are more stable  Stable Package:  Less dependent  Abstract classes and interfaces  Concrete and detailed code  Unstable Package:  More dependent  Concrete, detailed
  • 10.
  • 11. How to make a Package Stable??? Package may become stable if…  Package contains interfaces and abstract classes  It has no dependency on other packages or only dependent on stable packages
  • 12.  It contains relatively stable code Example: java.util  It is mandated to have a slow change schedule Example: java.lang
  • 13. Guideline#05: Factor out Independent Types  Organize types(classes) that can be used independently or in different classes into separate packages.  Keep above mentionedtypes into separate packages
  • 14.
  • 15. Guideline#06:Use Factories to Reduce Dependency on Concrete Packages  Reduce dependency of a package to concrete classes of other packages It will result in stability of the package How to achieve it? By using a factory object that will return us objects declared in terms of interfaces
  • 16.
  • 17. Guideline #07: No cycles in Package  If group of packages have cyclicdependency, then they may need to be treated as one large package.  It is undesirable.
  • 18.
  • 19. So what to do to achieve package stability???  We have the solution  Factor out the types participating in the cycles into a new smaller package  Break the cycle with an interface
  • 20. Steps to Break the cycle  1. Redefine the depended-on classes in one of the packages to implement new interfaces.  2.Define the new interfaces in a new package. 3. Redefine the dependent types to depend on the interfaces in the new package, rather than the original classes.