Docsity

Reuse - Principles of Software Development - Lecture Notes, Study notes of Software Engineering

Toggle sidebar
bg1
So far, we've assumed that the developer is working in a
vacuum.
In a realistic current project, a company will have a base
of existing software to leverage.
Do we write the software ourselves,
Or do we buy it from others?
Or do we get it for free from open source repositories?
Also, one commonly faces make/buy tradeoffs for
software components.
Reuse
Understand the make/reuse decision in detail.
Learn how to incorporate software reuse into design.
Goals of this lecture
Wednesday, October 21, 2009
10:53 AM
Reuse Page 1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f

Partial preview of the text

Download Reuse - Principles of Software Development - Lecture Notes and more Study notes Software Engineering in PDF only on Docsity!

So far, we've assumed that the developer is working in a vacuum. In a realistic current project, a company will have a base of existing software to leverage. Do we write the software ourselves, Or do we buy it from others? Or do we get it for free from open source repositories? Also, one commonly faces make/buy tradeoffs for software components. Reuse Understand the make/reuse decision in detail. Learn how to incorporate software reuse into design. Goals of this lecture Reuse Wednesday, October 21, 2009 10:53 AM Docsity.com

Lots of the field is about " stating the obvious ".

In this lecture, I am going to " state the obvious "

many times.

Why lecturing on software engineering is difficult:

Many things that are obvious once stated are not

obvious until stated!

But I am saved from complete oblivion and boredom by

one crucial fact:

This is "Couch's first rule of visualization"...!

Stating the obvious Wednesday, October 21, 2009 10:56 AM Docsity.com

Reusable: can be employed to accomplish

previously unforeseen tasks.

Portable: can run properly in various

architectures and/or environments.

Portable does not imply reusable, nor does

reusable imply portable.

What do the words mean? Monday, September 24, 2012 2:02 PM Docsity.com

Libraries: collections of subroutines that

accomplish specific, cohesive tasks

Programs: standalone software

components that can be called like

subroutines to accomplish specific tasks.

Services: running programs on remotely

located hosts that answer requests and

provide responses.

Patterns: documentation of the shape of

code required to solve a specific problem,

with or without language support.

Kinds of reusable software:

Kinds of reusable code Monday, September 24, 2012 2:06 PM Docsity.com

Every once in a while, a new release of

android comes out.

Installing it breaks about 1/2 of my

applications.

Every Sat morning, Google releases

updates of, e.g., 4 or so applications and

the phone asks me whether to load them.

I never say no.

ā—‹ Some of them work; some don't.

Thus on average, about 1/4 of the

applications loaded on my phone don't

work properly!

ā—‹ Including ones that I paid for!

A practical story: my android phone

A practical reuse story Monday, September 24, 2012 2:47 PM Docsity.com

I used Perl's library HTML::Parser library to construct a grading page.

  • The developers changed the semantics of parsing.
  • I am a very busy person! It took me a couple of years to adapt to the change, because I had not planned for something that ridiculous.

In the meanwhile, my 40,000-line grading package was useless.

"For want of a nail, a horseshoe was lost." Another typical reuse horror story Another typical reuse horror story Wednesday, October 21, 2009 11:54 AM Docsity.com

the user must adapt uses to changes in the

reused code.

this leads to a lag between updates to the

reusable code and the code that uses it.

Often, social inertia is all that protects the user

from ad-hoc changes.

the user of reusable code is at the mercy of the

implementor of the reusable code.

Coupling maintenance with reusable code

Coupling maintenance Wednesday, October 21, 2009 11:46 AM Docsity.com

lag behind developers of the reused code. maintain your code according to their development cycle. Committing to reuse also commits one to MS doesn't have a strong "desire" for average developers to be able to manipulate, e.g., Word documents. So, every release, there is a "lag" between the MS release and the 3rd-party products that try to read MS-format files. Committing to interact with Word files is a commitment to slave your own development cycle to the software that reads them, which is slaved to the MS development cycle. An arms race: Accordingly Wednesday, October 21, 2009 11:51 AM Docsity.com

design must adapt to pre-existing conditions.

input: existing base classes.

reuse model: inheritance/override

characteristics: works when desirable

behavior is "a kind of" existing behavior.

object-oriented : objects and inheritance

input: existing components.

reuse model: precondition/postcondition

analysis.

characteristics: works well when parts of

desirable behavior are implemented in

existing components.

component-based : components and interfaces

input: existing services (independent

programs running on distributed computers)

reuse model: schema-based verification of

input and output.

characteristics: freeform input and output.

service-oriented architecture : services and

clients

input: " patterns " are templates for

components

reuse model: fill-in-the-blanks.

characteristics: avoid re-inventing the

design patterns : patterns and instantiations

much of the action is in choosing an architecture

in which reuse can occur.

Design-centered reuse

Design centered reuse Wednesday, October 21, 2009 10:59 AM Docsity.com

characteristics: avoid re-inventing the

wheel for common algorithms and borrow

correctness from the templates!

Docsity.com

Service-oriented architectures (today)

Design patterns (tomorrow)

Two modern reuse enablers

Two modern reuse enablers Wednesday, October 21, 2009 11:33 AM Docsity.com

Idea: programs are composed from pieces distributed on different servers. Ideal application: maintenance of large corpora (databases). Caller provides an IP address Service returns Latitude/Longitude Example: IP to GPS coordinates service: More than software: google commits to update and curate the coporum. Service-oriented architectures Service-oriented architecture Wednesday, October 21, 2009 11:33 AM Docsity.com

Part of the eXtensible Markup Language (XML)

standard.

Extension of XML document-type-definitions

Define acceptable content for a service request or

response in XML.

Equivalent to a regular graph grammar with some

extensions

XSchemas

XSchemas Wednesday, October 21, 2009 11:40 AM Docsity.com

Basically, a very powerful way of expressing both preconditions and postconditions for a service. Limited to context-free assertions about structure of requests and responses, verifiable by pushdown automata. Any data must match a regular expression pattern. Not turing-equivalent! In other words, there are lots of things you might want to do in your input, e.g. What is an XSchema? Foo: Item 1 Item 2 Bar: Item 3 Item 4 that are contextual (upon the label Foo and Bar) and thus cannot be represented. You must represent these as something like: What is an XSchema? Wednesday, October 21, 2009 12:00 PM Docsity.com