Property of Penn Engineering
What is Modularity?
Copyright By PowCoder代写 加微信 powcoder
Property of Penn Engineering
l Analyzability: readability and understandability
l Changeability: ease with which code can be changed
l Stability: modifying one part has limited effect on others
l Testability: controllability, observability
l Reusability: can be used in a variety of applications
Review: Internal Quality
Property of Penn Engineering
Presentation Get input from user.Display output.
Logic Perform calculations.Make decisions.
Data Store and retrieve data.
Three-Tier Architecture
Property of Penn Engineering
How Do We Achieve Internal Quality?
Requirements
Analyzability
Changeability
Testability
Property of Penn Engineering
• Modularity: each component addresses a single part of the
functionality
• Functional Independence: components should have minimal
dependence on other components
• Abstraction: components should be able to use other
components with minimal knowledge of the details of their
implementation
Software Design Concepts
Property of Penn Engineering
•Design a Java program that reads a file containing info
about courses, instructors, and enrollment
• And then allows the user to choose to see:
• the instructor(s) for a given course
• the course(s) taught by a given instructor
• the average enrollment for a given course
Motivating Example
Property of Penn Engineering
• Each component (“module”) addresses a single part
of the functionality
• In Java, this is often accomplished simply by creating
separate classes
• Cohesion: parts of a class “go together” and the class
isn’t responsible for doing too much
Modularity: “Separation of Concerns”
Property of Penn Engineering
• Analyzability: leads to smaller pieces of code, each of
which is easier to understand
• Testability: permits testing of individual pieces; easier to
find and fix bugs
• Reusability: pieces of code can be reused in this
application or in other applications
• Changeability: easy to find code that needs to be changed
(and then change it!)
Why Modularity?
Property of Penn Engineering
• Format of input: CSV, JSON, XML, etc.
• Layout of format: ordering of fields
• Source of input: file, database, web service
• How errors are handled
What Could Change? Data Tier
Property of Penn Engineering
• Logic of conducting the search
• Details of the search, e.g. whether it’s case-sensitive
• How errors are handled
What Could Change? Logic Tier
Property of Penn Engineering
• (Human) language used in UI
• Prompts for input
• Mechanism for input
• Format of output
• UI technology: command line, Swing, Android
• How error messages are displayed
What Could Change? Presentation Tier
Property of Penn Engineering
• Each component (“module”) addresses a single part
of the functionality
• Improves analyzability, testability, and changeability
Summary: Modularity
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com