SDA Lab Tasks To Solve
SDA Lab Tasks To Solve
Architecture
Lab No. 12
Software Reuse
Objectives
36
Department of Software Engineering Department
Bahria University (Karachi Campus)
Lab 12
Software Reuse
Introduction
• Code reuse is the use of existing software to build new software. It is one of the holy grails of modern
software development. APIs provide a mechanism to enable code reuse.
• In the early years of software development, it was common for a company to have to write all of the
code for any application they produced.
• If the program needed to read GIF images or parse a text file, the company would have to write all
that code in-house. Nowadays, with the proliferation of good commercial and open source libraries
• software development has become much more modular, with the use of distinct components that
form the building blocks of an application and talk together via their published APIs.
• The benefit of this approach is that you don't need to understand every detail of every software
component, in the same way that for the earlier house building analogy you can delegate many details
to professional contractors.
• It also allows you to concentrate on your core business logic instead of having to spend time
reinventing the wheel.
Google Map Zoom Values
• World: Zoom level 1 shows the whole world.
• Continent: Zoom level 5 shows a continent.
• City: Zoom level 10 shows a city.
• Streets: Zoom levels 15 to 17 show streets.
• Buildings: Zoom level 20 shows individual buildings.
Code:
<!DOCTYPE html>
<html><body>
<h1>My First Google Map</h1>
<div id="googleMap" style="width:100%;height:400px;"></div>
<script>
function myMap() {
var mapProp= {
center:new google.maps.LatLng(51.508742,-0.120850),
zoom:20,};
var map = new google.maps.Map(document.getElementById("googleMap"),mapProp);}
</script>
<script
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCUObL9wwx2FzW91DzHRN8wif2ct0
7cIDg&callback=myMap"></script>
</body></html>
YOUR_GENERATED_API_CODE
37
Department of Software Engineering Department
Bahria University (Karachi Campus)
Software Reuse Examples
• Shared Libraries
• Plugins
• In our example scenario we are building shared library project that performs basic calculation. • We
will create two projects.
• 1st project contains calculation class that can be used for accounting in the project.
• We will use this project in our 2nd project as DLL shared library for calculation purpose.
Time Boxing
Activity Name Activity Time Total Time
Login Systems + Setting up Visual Studio Environment 3 mints + 5 mints 8 mints
Walk through Theory & Tasks 60 mints 60 mints
Implement Tasks 80 mints 80 mints
Evaluation Time 30 mints 30 mints
Total Duration 178 mints
Objectives
After completing this lab, the student should be able to:
• Clearly understand the purpose and benefits that Software Reuse has to offer for Software
Engineering.
• Understand the concept of Software Reuse.
• Build basic program using Software Reuse.
• Use and learn Software Reuse need in Software Engineering.
TASKS
1. Create Reusable Code/Software for generating Marksheet of a student. (Hint: Use Project 1 for
calculation and Grading purpose)
38
Department of Software Engineering Department
Bahria University (Karachi Campus)