Software reuse William W. McMillan 28 March 2013
Benefits of Reuse • Save resources. • Standardize a solution that can be trusted. • Support levels-of-abstraction approach to creating systems. • Encapsulated “black-box” components. • Reduce tedium, allow developers to work on new things.
Risks of Reuse • Propagate inefficient solution. • e.g., O(N2) sorting routine • Propagate incorrect solution. • Stats formula could be wrong or inappropriate. • Shield developers from fundamental knowledge of how something works. • May not know inefficiencies of solution in particular context. • May miss interactions and dependencies.
Risks of Reuse • Hard to change or update reused component. • Long-term cost if there’s a license fee. • Loss of support if provider goes belly-up.
Suppose a method to compute a standard error of the mean is incorrect. What are some potential costs if the routine is used repeatedly?
History of Reuse • Copy someone’s source code to do a task. • Subroutines: • Well-defined modules, with name, • … but might use common data structures. • Call subroutines with parameters. • “Include” files. • External libraries of useful routines. • E.g., LINPACK for linear algebra and related. • Database tools like Ingres
History of Reuse • Computer simulation led to object-oriented design. • Simula 67 • Packages and “Units” appeared. • UCSD Pascal, Ada. • Abstract data types influential in computer science. • Object-oriented goes mainstream: • C++, O-O capabilities bolted onto C. • Smalltalk from a more AI perspective.
History of Reuse • Java cleans up a lot of O-O trash: • Multiple inheritance gone. • No “friend” access. • Better dynamic memory management. • C# is Microsoft’s version of Java. • Packages, APIs, components now common. • A lot of development is done on top of: • Statistics packages • SQL engines • Enterprise mega-packages like SAP
How have people employed books and tutorials on programming and scripting in software reuse?
Reuse of Software Ideas • Algorithms and data structures. • Useful architectures and design patterns (discussed earlier in course). • E.g., model-view-controller • Programming styles. • Elements of Programming Style by Kernighan and Plauger • Relational databases.
What benefits do you gain in being familiar with the idea of a sparse matrix?
Software Frameworks • Integrated sets of tools and utilities. • E.g., .NET, Enterprise Java Beans, Allegro Common Lisp. • User interface objects and methods. • Communication facilities. • Security tools. • Data structures. • Database management. • Web applications. • Session and transaction management.
Families of Software Products • E.g., Microsoft Office, Adobe Creative Suite. • Might have unique scripting language. • UI has similar feel and style across members. • Compatible parts. • Common architecture. • Common data formats. • Incentives to use all or none. • Reasons to keep all parts up to date.
Buy Commercial Software? • E.g., SAP, E-Commerce tools. • Why reinvent the wheel? • Why not get expert advice and help? • Reduce costs, especially maintenance. • Reduce liability. • Get things you might not have thought of: • Encryption, back-up facilities, slick algorithms,…
Use Open-Source Software? • Talk about saving costs…. • But do you always save? • Where does support come from? • “Read the source code” isn’t always the help you need. • Need to consider long-term costs and risks.
When would you advise a client to consider including open-source software in a system?
Use Cloud-Based Services? • E.g., Amazon, AT&T. • Third-party provider. • Data and functions on servers managed by provider. • Includes many tools. • Access via the Internet.
A client says, “I want this to be a cloud-based system.” What questions would you ask in order to respond intelligently?