ISBN : 978-81-963532-2-3 (E-Book) Canweparameterizeanon-reusablecomponent sothat itbecomesreusable? Refining products for greater reusability. For a product to be reusable, it must berelatively easy to adapt it to different contexts. Machine dependency must be abstractedout or localized using data encapsulation techniques. The following refinements may becarriedout: • Name generalization: The names should be general, rather than being directlyrelatedto a specificapplication. • Operation generalization: Operations should be added to make the componentmoregeneral.Also,operationsthataretoospecifictoanapplicatio ncan be removed. • Exception generalization: This involves checking each component to see whichexceptions it might generate. For a general component, several types of exceptionsmighthaveto be handled. • Handlingportabilityproblems:Programstypicallymakesomeassumpti onregardingtherepresentationofinformationintheunderlyingmachine.Thes eassumptions are in general not true for all machines. The programs also often need tocall some operating system functionality and these calls may not be same on allmachines. Also, programs use some function libraries, which may not be available onallhostmachines.Aportabilitysolutiontoovercometheseproblemsisshow ninfig. 41.1. The portability solution suggests that rather than call the operating system andI/O procedures directly, abstract versions of these should be called by the applicationprogram. Also, all platform-related calls should be routed through the portabilityinterface. One problem with this solution is the significant overhead incurred, whichmakes it inapplicable to many real-time systems and applications requiring very fastresponse. 220 Software Engineering Keerthana P, Manasa KN, Ganga D Bengal
226 Publizr Home