Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!seal.cis.ohio-state.edu!ogden From: ogden@seal.cis.ohio-state.edu (William F Ogden) Newsgroups: comp.sw.components Subject: Re: What is a reusable software component? Keywords: software component definition Message-ID: <82559@tut.cis.ohio-state.edu> Date: 30 Jul 90 22:43:53 GMT References: <27705@athertn.Atherton.COM> <533@helios.prosys.se> <27914@athertn.Atherton.COM> Sender: news@tut.cis.ohio-state.edu Reply-To: William F Ogden Organization: Ohio State University Computer and Information Science Lines: 50 In response to comments from Anders, Paul writes: ... >>* browser >> >> That is, providing a `bt_user_search(tree)' which presents the data >> in the tree, and lets the user select an item for further computation. >> >>This is something I think most components that implement data structures >>should have. At least those implementing `complicated' structures. > >It is debatable whether or not a component should provide a browsing >capability or not. It has no way of knowing what the client has stored >there. It could, however, provide bt_getFirst, bt_getLast, bt_getNext, >and bt_getPrev functions that work in conjunction with the bt_search >function to provide the functionality needed for the client to locate >information and provide a more effective browser. Now here we are getting into a real reusablity issue. In designing a facility for reuse, it is important to try to distinguish between primary and secondary operations on a structure. The Get_First, Get_Next, etc. are primary operations on the reusable structure of which the B-tree is one realization. Traverse or print-out operations are secondary, since they can be implemented easily and efficiently using the primary ones -- provided Get_Next, etc. are included as primaries. There are generally a vast number of potentially useful secondary operations on a structure, but any particular application will only require a small subset. Moreover the next application may need other strange secondary operations which nobody ever considered. Under these circumstances, achieving facility reuse without modification seems paradoxical until you see that with proper design, secondary operations can be added without changing the underlying implementation. Determining which operations are primary and which secondary is somewhat like finding a basis for a vector space of an independent set of axioms for a mathematical theory. You list all the operations on a structure that you can imagine anyone wanting (of course you'll turn out to lack imagination) then you figure out which ones can be implemented using which others. A small (and generally useful) subset, in terms of which all the others can be implemented, form the nucleus of the reusable facility. >It is also debatable as to whether or not a data structure such as a >B-tree should provide the user interface code needed to support such a >browser. Clearly it shouldn't. It involves either a set of secondary operations or more likely a separate facility. /Bill