王廷瑋|數位醫療|智慧醫療: Patterns, Implementation, Maintenance & Reuse WFU

2024年7月23日 星期二

Patterns, Implementation, Maintenance & Reuse

Design Patterns


  • Solution to a commonly occurring design problem that can be applied over and over again in many different project context.
  • A formal design pattern has a name, a description of the problem it solves, and a solution strategy
  • Design patterns also incorporate best practices in their solutions, and result in very flexible, and reusable designs.
  • Creational patterns
    • address design issues that focus on how to make a system independent of how its objects are created which results in designs very robust in response to changes.
  • Structural patterns
    • describe ways to design objects that work with each other in very robust ways to realize new functionality
  • Behavioral patterns
    • deal with how to assign responsibilities to objects and how objects communicate with one another


Sample Design Patterns


  • Singleton pattern
    • used when we want to ensure that only a single instance from a class is instantiated
    • class constructor is not made public.
    • static variable “instance”, which in this case is a pointer to a Singleton object
    • static method named Instance, that returns a pointer to the unique Singleton object
  • Façade pattern
    • can be used to provide a unified, more simplified interface that hides any complex relationships that might exist
  • Observer pattern
    • publish-subscribe pattern
    • very useful pattern in situations where an object needs to notify other objects whenever its state changes


Implementation


  • component reuse
  • framework reuse
  • level of reuse
    • clear box: we can’t see the code
    • translucent box: Not only can we see
    • the code, but we can make changes to it
    • black box: can see can’t change


Benefit of reuse


  • Software reliability, as well as hardware reliability, is measured as “mean time to failure,” or MTTF.
  • There are two main reasons why reused software has higher reliability than hand-crafted software.
    • if I am building some software that I know will be reused by other people; I will take more care to do a good job.
    • software has higher reliability is because of something we will cover in our module on assuring software quality
  • less expensive
  • capture expert knowledge
  • standardization
  • less develop time


Impediments to Reuse


  • creating components
  • paying
  • not exact fit
  • legal
  • trust


Software maintenance


  • why we need to do maintenance
    • The better products actually received bigger maintenance budgets than the poorer ones
    • Corrective maintenance is fixing bugs
    • Adaptive maintenance is when we make changes to keep up with new technology such as new hardware or operating systems.
    • perfective maintenance
  • cost maintenance
    • 60% to 80% of the total life cycle cost of software is in maintenance
    • Another thing to keep in mind is that we are continually building more software that will need to be maintained.
    • The only thing we can do is to reduce the unit cost of maintenance.