0% found this document useful (0 votes)
45 views3 pages

SDA Lab Tasks To Solve

The document discusses software reuse and provides examples of reusing code through APIs, shared libraries, plugins and extensions. It describes creating a shared library project for basic calculations and consuming it in another project as well as consuming the Google Maps API to display a map on a webpage.

Uploaded by

Rehab Khaleel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

SDA Lab Tasks To Solve

The document discusses software reuse and provides examples of reusing code through APIs, shared libraries, plugins and extensions. It describes creating a shared library project for basic calculations and consuming it in another project as well as consuming the Google Maps API to display a map on a webpage.

Uploaded by

Rehab Khaleel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab Manual for Software Design and

Architecture

Lab No. 12
Software Reuse

Objectives

To get familiar with Software Reuse.

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

• Api(Application Programming Interfaces). Google Apis(Maps, Cloud, Firebase, Drive … etc)

• Shared Libraries

• Plugins

• Extensions: eg: (NewtonSoft Json) we have used in previous lectures task

Creating Reusable Software Example

• 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)

2. Consume Google Maps Api in Html Webpage.

38
Department of Software Engineering Department
Bahria University (Karachi Campus)

You might also like