You are on page 1of 27

<Company Name>

CRM for SMEs


Software Architecture Document

Version <1.0>

[Note: The following template is provided for use with the Rational Unified Process. Text enclosed in
square brackets and displayed in blue italics (style=InfoBlue) is included to provide guidance to the author
and should be deleted before publishing the document. A paragraph entered following this style will
automatically be set to normal (style=Body Text).]
[To customize automatic fields in Microsoft Word (which display a gray background when selected), select
File>Properties and replace the Title, Subject and Company fields with the appropriate information for
this document. After closing the dialog, automatic fields may be updated throughout the document by
selecting Edit>Select All (or Ctrl-A) and pressing F9, or simply click on the field and press F9. This must
be done separately for Headers and Footers. Alt-F9 will toggle between displaying the field names and the
field contents. See Word help for more information on working with fields.]
ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Final Project ALL B2B<Company Name>, 2009 Page 2 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Table of Contents
1. Introduction 5
1.1 Purpose 5
1.2 Scope 5
1.3 Definitions, Acronyms, and Abbreviations 5
1.4 References 6
1.5 Overview 6

2. Architectural Representation 7

3. Architectural Goals and Constraints 7


3.1 Constraints 7

4. Use-Case View 8

5. Logical View 8
5.1 Overview and Architecturally Significant Design Packages 8
5.2 Use-Case Realizations 9

6. Process View 12

7. Deployment View 12

8. Implementation View 13
8.1 Overview 13

9. Data View (optional) 14

10. Size and Performance 14

11. Quality 15

12. Previous study 15

13. Specific requirements 16


13.1 List enterprises 16
13.2 Select an enterprise 16
13.3 Modify enterprise 17
13.4 List products of an enterprise 17
13.5 Select an product of an enterprise 17
13.6 Modify product 18
13.7 See tags 18

14. Installation manual 18

15. User manual 20

16. Implementation 24

Final Project ALL B2B<Company Name>, 2009 Page 3 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

16.1 PHP Code 24


16.2 Style 25
16.3 Google API and JavaScript 26

17. References 27

Final Project ALL B2B<Company Name>, 2009 Page 4 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Software Architecture Document


1. Introduction
[The introduction of the Software Architecture Document provides an overview of the entire Software
Architecture Document. It includes the purpose, scope, definitions, acronyms, abbreviations, references,
and overview of the Software Architecture Document.]

1.1 Purpose
This document provides a comprehensive architectural overview of the system, using a number of different
architectural views to depict different aspects of the system. It is intended to capture and convey the
significant architectural decisions which have been made on the system.

The goal of this Project is to improve the business of an enterprise. In order to get this target, we will use
information from Internet and private data provided from Internet in the most popular webpage. Then we
will show in a friendly way all of this information.

[This section defines the role or purpose of the Software Architecture Document, in the overall project
documentation, and briefly describes the structure of the document. The specific audiences for the
document is identified, with an indication of how they are expected to use the document.]

1.2 Scope
[A brief description of what the Software Architecture Document applies to; what is affected or influenced
by this document.]
The scope of this project is IT (Information technology), the main goal of this project is to give information
to company that can be used for improve their business. This information is provided from internet,
searchers, news portal, e-business WebPages… and private data that are provided from the company. After
that, when you have all of that information, you can mix them and show that to the last user in a friendly
way, so this user can use it for its benefits.
Due to this goal, the use of internet will be crucial for getting results. Some web pages offer an API
(Application Programming Interface) that let us connect to their private data and use them for our benefits.
Moreover, we can use Web Services to retrieve more information from internet, and then we will show all
the information we retrieve from internet

1.3 Definitions, Acronyms, and Abbreviations


[This subsection provides the definitions of all terms, acronyms, and abbreviations required to properly
interpret the Software Architecture Document. This information may be provided by reference to the
project’s Glossary.]
SME: small and medium enterprises (also SMEs, small and medium businesses, SMBs, and variations
thereof) are companies whose headcount or turnover falls below certain limits.
CRM: customer relationship management (CRM) consists of the processes a company uses to track and
organize its contacts with its current and prospective customers. CRM software is used to support these
processes; information about customers and customer interactions can be entered, stored and accessed by
employees in different company departments. Typical CRM goals are to improve services provided to
customers, and to use customer contact information for targeted marketing.
API: is a set of routines, data structures, object classes and/or protocols provided by libraries and/or
operating system services in order to support the building of applications.
PHP: is a scripting language originally designed for producing dynamic web pages. It has evolved to
include a command line interface capability and can be used in standalone graphical applications.

Final Project ALL B2B<Company Name>, 2009 Page 5 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

B2B: business-to-business (B2B) describes commerce transactions between businesses, such as between a
manufacturer and a wholesaler, or between a wholesaler and a retailer. Contrasting terms are business-to-
consumer (B2C) and business-to-government (B2G).
XAMPP: is a free and open source cross-platform web server package, consisting mainly of the Apache
HTTP Server, MySQL database, and interpreters for scripts written in the PHP and Perl programming
languages.

1.4 References
During this project some documents have help me to develop the final solution. Somehow, I have used
them like tutorials, like manuals…
Then, this is the list of references:
• Google API: I used Google API for the searchers on the internet and for the location of the
company. We can see all the documentation in this web
http://code.google.com/apis/ajaxsearch/documentation/
• PHP API: I have been using the PHP API in the official website for programming
http://www.php.net/manual/es/
• MySQL references: I used a document from Internet of the official website of MySQL, it is
http://dev.mysql.com/doc/
• APACHE documentation: In order to configure the APACHE web server I used also the official
documentation, http://httpd.apache.org/docs/2.2/
• CSS: I have been using some web pages for helping, but the main was
http://es.html.net/tutorials/css/
• XAMPP: In order to use this package I used again the official website where you can follow a
simple guide to install XAMPP, I followed the official documentation,
http://www.apachefriends.org/en/xampp-windows.html

1.5 Overview
[This subsection describes what the rest of the Software Architecture Document contains and explains
how the Software Architecture Document is organized.]
The rest of the Software Architecture Document contains all the information related with the project
development, characteristics, architecture…
This software is made of several technologies. They are PHP and MySQL and they are working in an
APACHE web server. Therefore, we need XAMPP because it provides us, in an easy way, all of those
technologies in a package and also programs to manage them.
In general, the technologies I’ve used are the next:
• PHP:(see point 1.3).
• MySQL: is a relational database management system.
• APACHE: is a web server.
• HTML: an acronym for HyperText Markup Language, is the predominant markup language for
web pages.
• JavaScript: is a scripting language used to enable programmatic access to objects within other
applications. It is primarily used in the form of client-side JavaScript for the development of
dynamic websites.

Final Project ALL B2B<Company Name>, 2009 Page 6 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

• CSS: is a style sheet language used to describe the presentation (that is, the look and formatting)
of a document written in a markup language. Its most common application is to style web pages
written in HTML and XHTML, but the language can be applied to any kind of XML document,
including SVG and XUL.
• WebServices: is defined by the W3C as "a software system designed to support interoperable
machine-to-machine interaction over a network.

2. Architectural Representation
[This section describes what software architecture is for the current system, and how it is represented. Of
the Use-Case, Logical, Process, Deployment, and Implementation Views, it enumerates the views that are
necessary, and for each view, explains what types of model elements it contains.]
I use UML as the software architecture for the current system. It is represented by UML diagrams,
specifically 4+1 View Model.
• Use-case view: I have used it because thanks to its annotation we can represent the diagrams in an
easy way. It contains actors, represented by a person and use case, represented by circles.
• Logical view: The logical view is represented by class diagram in UML and it has classes and
arrows that represent the relationships between them.
• Deployment view: In this view we have use the UML Deployment Diagram representing the
server, the technologies and so on.
• Implementation view: It is divided in layers, one layer for PHP and Web, and the other for the
database and the Google API.

3. Architectural Goals and Constraints


[This section describes the software requirements and objectives that have some significant impact on the
architecture; for example, safety, security, privacy, use of an off-the-shelf product, portability, distribution,
and reuse. It also captures the special constraints that may apply: design and implementation strategy,
development tools, team structure, schedule, legacy code, and so on.]

3.1 Constraints
There are several things that have some impact in the software. The own features of the system made that
we need, as one of the main characteristics, Internet, because our system is based on B2B WebPages on the
Internet. Then, in order to use our system it is always required a computer with an internet connection,
which makes it a big constraint because some companies block internet to their workers.
Other of the main constraints is that we will be always a Google dependent, because we use its API, and
Google is a private company, so if one day Google disappear our software, theoretically, will not work,
anyway, we can trust in this company because it is one the most important companies in the world.
Moreover, the system require the Google API and it use to change in the time, however it is not necessary
to be worried because the new API always support the older API.
Other constraint is that we use B2B WebPages and if they change or disappear as well, our software will be
affected.
On the other hand, we have other constraint because the technology we are using. Always it will be
required a web server that support PHP.

Final Project ALL B2B<Company Name>, 2009 Page 7 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

4. Use-Case View
[This section lists use cases or scenarios from the use-case model if they represent some significant, central
functionality of the final system, or if they have a large architectural coverage—they exercise many
architectural elements or if they stress or illustrate a specific, delicate point of the architecture.]
I’ve used the UML methodology, specifically use cases. I have extracted some artifacts. First of all I’ve
defined the actors of the system. For my solution I have one actor.
• User: ser: This user can read and update information provided by the system, for example, he can
update private data of the company, public data provided from internet, the geography location,
tags…. Specifically he can do these things:
o Update/see company data: this user can update the private data of a company.
o Update/see products: this user can update the information of the products of a company.
o See geography location: the user can see where the location of the company is.
o Update company tags: the user can update de tags related with a company.
o Update products tags: the user can update de tags related with the company products.
o Navigate to the original B2B webs: the user can navigate to the search results.

Figure 1
5. Logical View
5.1 Overview and Architecturally Significant Design Packages

[This section describes the architecturally significant parts of the design model, such as its decomposition
into subsystems and packages. And for each significant package, its decomposition into classes and class
utilities. You should introduce architecturally significant classes and describe their responsibilities, as well
as a few very important relationships, operations, and attributes.]
In order to represent the system we use 3 packages, one with the PHP files, and other with a CSS file and
the last one with a JavaScript file. The first one has the next files:
• db_connection.php: connection to the database.
• list_companies.php: list of all the companies of the database.
• company.php: it shows us the company private data of a company.

Final Project ALL B2B<Company Name>, 2009 Page 8 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

• products.php: it shows us the company products.


• product_details.php: it shows us the company product details.
• tags_products_list.php: it shows us the company product tags.
In the second packet we use another kind of files, particularly CSS files, to represent the style of the
website:
• style.css: the style of the website.
Finally, we use a JavaScript file for connecting to the Google API in the third packet:
• jscript.js: the connection to the Google API.

Figure 2

5.2 Use-Case Realizations


[This section illustrates how the software actually works by giving a few selected use-case (or scenario)
realizations, and explains how the various design model elements contribute to their functionality.]
For example, in the use-case update/see company data and see public data we can see the main features of
the system because it shows us part of the most important information. You can see the company public
and private information only in one file, specifically company.php, so these use-cases and the file
contribute to the functionality.
In the sequence diagrams we can see clearly how the system works.
In the next figure we see how behave the system when we select a company. First of all the user see the
whole companies list and then he/she select the company and then the system show us all the private and
public data of the specific company.

Final Project ALL B2B<Company Name>, 2009 Page 9 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Figure 3.

In the next diagram we can see how to see the products of a company. In this case, we select the company,
then we make click on the products and then we can see all of them. The next figure shows us all the
process.

Figure 4.

Continuing with the sequence diagrams, in the next we can see how to retrieve all the information of a tag.
In this case we select the company and then the tags, where we can see all the products and companies
related with the tag mentioned before.

Final Project ALL B2B<Company Name>, 2009 Page 10 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Figure 5.

In the last sequence diagram we can see how to get the details of a product. More or less it is always the
same process, but in this case regarding the details of a product, where we can see its details, both public
and private, and also we can update this information, obviously not the public.

Figure 6.

On the other hand the system has 8 main processes. They do all of the main functionality of the system,
thanks to them we can see the system results. Following there is a short description and you can see the
structure in the next figure:
Companies list: this process shows us all the companies of the system.
Company private information: this process, after the selection of a company in the Companies list
process, shows us all the private data of a company.
Company public information: this process, after the selection of a company in the Companies list
process, shows us all the public data of a company by connecting to the Google API.
See all the products of a tag: in this process we can see all the products related with a tag, no matter the
company.
Update company/tags: this process update the private information of a company, both tags and other data.

Final Project ALL B2B<Company Name>, 2009 Page 11 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Products: this process shows us all the products of a company.


Update product/tags: this process let us to update tags and private data of a product.
Product public information: this process let us to know the public information of a product by connecting
to the Google API.

Figure 7

6. Process View
[This section describes the system's decomposition into lightweight processes (single threads of control)
and heavyweight processes (groupings of lightweight processes). Organize the section by groups of
processes that communicate or interact. Describe the main modes of communication between processes,
such as message passing, interrupts, and rendezvous.]
The system’s decomposition is in lightweight processes and heavyweight processes, but in general this
processes are handle by APACHE, because this Web Server is able to manage the requests and answers.
Then, when someone tries to get into our system it becomes in a lightweight threat and then, being an
independent threat it can be use the features of our system.
On the other hand we have a heavyweight process, this is the APACHE process, and it executes all the
heavy stuffs.
Other heavyweight process is the MySQL process, that execute all the stuffs regarding the database and the
requests and aswers.

7. Deployment View
[This section describes one or more physical network (hardware) configurations on which the software is
deployed and run. It is a view of the Deployment Model. At a minimum for each configuration it should
indicate the physical nodes (computers, CPUs) that execute the software and their interconnections (bus,
LAN, point-to-point, and so on.) Also include a mapping of the processes of the Process View onto the

Final Project ALL B2B<Company Name>, 2009 Page 12 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

physical nodes.]
In the next schema we can see the physical network configuration on which the software is deployed and
run. The schema is a view of the deployment model.
The physical nodes are the computer which send request to the server and this one is working in a computer
with a Linux or Windows O.S., no matter which O.S., but it is important to use XAMPP because is it the
base of our system. For the prototype it is no required to have a server with big capabilities.
In general, there is a server with XAMPP running MySQL, PHP and APACHE where is the entire program
and all the processes. The computers on the Internet ask for information to the website.
For running our project we always will need a web browser.

Figure 8
8. Implementation View
[This section describes the overall structure of the implementation model, the decomposition of the
software into layers and subsystems in the implementation model, and any architecturally significant
components.]

8.1 Overview
[This subsection names and defines the various layers and their contents, the rules that govern the
inclusion to a given layer, and the boundaries between layers. Include a component diagram that shows the
relations between layers. ]
The system finally is made of two layers. The first one has the web layer and the PHP layer. Here is where
all the programmatic functions are, and also the design of the system.
The other layer is with the servers, both MySQL and APACHE. And also this layer has the Google API, it
is where you can connect to the Google Database and use other functions.

Final Project ALL B2B<Company Name>, 2009 Page 13 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Figure 9.

9. Data View (optional)


[A description of the persistent data storage perspective of the system. This section is optional if there is
little or no persistent data, or the translation between the Design Model and the Data Model is trivial.]
The next schema is a description of the persistent data storage perspective of the system. The prototype has
five tables that let us organize all the private information of the companies. Now a short description of each
one:
• Companies: it is a table with the private information of the companies.
• Products: it is a table with the products of the companies.
• Tag: it is a table with the id and the name of the tags of the system.
• Tags_company: this is a table with the labels belonging to a company.
• Tags_products: this is a table with the labels belonging to a product.

Figure 10.
10. Size and Performance
[A description of the major dimensioning characteristics of the software that impact the architecture, as
well as the target performance constraints.]

Final Project ALL B2B<Company Name>, 2009 Page 14 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

In the case of the major dimensioning characteristics of the software, the architecture maybe would be
collapsed because it can’t afford all the requests, so in this case and if this situation keeps on time we
should change the architecture, studying which is better.

11. Quality
[A description of how the software architecture contributes to all capabilities (other than functionality) of
the system: extensibility, reliability, portability, and so on. If these characteristics have special
significance, such as safety, security or privacy implications, they must be clearly delineated.]
The quality of software is something very important for a program. In the engineering software process is
necessary to have quality because then we can update, modify, etc. this software easily, as well as having
understandable software. In this case, we have a packet called XAMPP that let us having the best
integration between these 3 technologies: PHP, APACHE and MySQL. Regarding this, we know that the
chosen architecture is quite good, because they are closely related with the solution of the problem.
A part of this, the XAMPP packet has strict policies of safety, privacy and security because it is a packet
with a lot of experience and years and also you can manage the security by yourself thanks to the packet.

12. Previous study


This project has a big previous study to know which features on the internet are the best. During this part
we will reference Biao Yu, Yan Liu [10] document, because this part is based on their research. So then, we
can divide these features in three dimensions. Reading some papers and taking some data from different
references we realize that the best characteristics for a system are specifically: reputation, geographic
information and type. Now, we describe a little each one:

Reputation

The best to have the description of this dimension is to reference Biao Yu and Yan Liu [10] document:
“This dimension used for depict the enterprise is the most important of all. Reputation means a lot,
including integrity, reliability, and sustainability. Under normal circumstances, if we want to know that
kind of information, it may take us too much time to find out. And sometimes, we cannot get the real data. It
depends on the search engine we used, the websites we visited, and the trust model we established.
Renate Eisentraut [8] mentioned “Reputation Indicator”. Some recent work on trust-building in the net
follows this strategy. And reputation indicators are used in several online systems. The idea behind them is
to collect ratings about potential partners from other users who already have worked with them and to
calculate a reputation indicator therefrom. This indicator then is made accessible for potential partners to
help them evaluate each other. Examples are online auction platforms like ebay or comment platforms like
dooyoo.
Renate Eisentraut [8] also describes the weakness of a reputation indicator. That is it merely represents the
aggregation of anonymous ratings, whereas valid information about the identity, competence, and
trustworthiness of the raters as well as about the context and background of the ratings is lacking.”
For the reputation, we used several B2B websites, as we think are the best and famous ones, and also we
used the normal Google search for the company in particular:
www.globalsources.com
http://www.alibaba.com/
http://dir.yahoo.com/Regional/Countries/Germany/Business_and_Economy/Business_to_Business/
http://www.tradeprince.com/

Final Project ALL B2B<Company Name>, 2009 Page 15 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

http://www.exportnation.com/trade/
Geographic Information
Referencing again Biao Yu and Yan Liu [10] document, because this is the best way to describe this
dimension: “In order to do a successful business, knowing exactly where is your partner company is quite
important. Not only because the geographical conditions, transportation conditions and the work
environment, but also the public facilities and enterprise development strategy”, because of this we chose
to sow the company location in two ways. One is with the exact address of the company and the other is
with the name of the company. Supporting this idea we can read the following quote of Biao Yu and Yan
Liu [10] document:
“Usually, in the exclusive data, there’s always a company’s address. It cannot give us more information
than only several words. Sometimes, we could not find the company according to that address. Therefore,
we should use other data like company name binding that address to search for the company.
Some companies have one or more subsidiaries. Choosing the proper subsidiary may minimize the
spending of both sides and make the business more flexible.”
Type
Type is very important in the intelligence of a company because it let you to know which fields are related
to your company, as Biao Yu and Yan Liu [10] say in their document: “For a company, type is a vital
property. It includes domain knowledge and product information”, so the best way to represent type is with
tagging, according with the next principle also of Biao Yu and Yan Liu: “Tagging has recently acquired
popularity as a lightweight and flexible approach to classifying information. Tagging enables individuals
to use whatever terms they think are appropriate to describe or help them recall a resource without the
burden of selecting a category from a known taxonomy. It has been applied in a variety of applications
ranging from desktop applications for organizing photos (F-spot) to web email systems (Gmail). Tagging
becomes most compelling when it is used in a collaborative environment, and tags from different people
can be aggregated and combined”

13. Specific requirements

13.1 List enterprises


Introduction
You can see all the list of registered companies in the system.
Input
The system will check the database with the registered companies.
Process
The system will run an algorithm to show the companies.
Output
The system will show a list of companies.

13.2 Select an enterprise

Introduction
You can choose an enterprise among the list of these ones and see the information of that.
Input

Final Project ALL B2B<Company Name>, 2009 Page 16 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

You select an enterprise in the list of enterprises.


Process
The system will run to show the features of the company
Output
We will see the features of the company, both public and private mixed: reputation, geography location and
tags.

13.3 Modify enterprise


Introduction
You can update a company in the system.
Input
The system will check the database with the registered companies and it will show you the selected
company. Then you type the data you want to modify.
Process
The system will run an algorithm modify the company.
Output
The system will show the modify company.

13.4 List products of an enterprise


Introduction
You can see all the list of registered products of a company in the system.
Input
The system will check the database with the registered company products.
Process
The system will run an algorithm to show the company products.
Output
The system will show the company products list.

13.5 Select an product of an enterprise

Introduction
You can choose a product among the list of these ones and see the information of that.
Input
You select a product in the list of enterprises.
Process
The system will run to show the features of the product.
Output
We will see the features of the product, both public and private mixed.

Final Project ALL B2B<Company Name>, 2009 Page 17 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

13.6 Modify product


Introduction
You can update a product in the system.
Input
The system will check the database with the registered product. Then you type the data you want to modify.
Process
The system will run an algorithm modify the product.
Output
The system will show the modify product.

13.7 See tags


Introduction
You can see all the products related with a tag.
Input
The system will check the database with the registered company products and their tags.
Process
The system will run an algorithm to show the company products that have the selected tag.
Output
The system will show the products list.

14. Installation manual


The installation of the software is quite simple thanks to packages like XAMPP.
First of all we will need all the packages:
• XAMPP: we can download from http://www.apachefriends.org/en/xampp-windows.html . If we
want to install the system in Linux is the same process.
• PHP+HTML+CSS+JavaScript package
• SQL package

After we download we will have an .exe file, then we only have to install like all the documents in
Windows, we have to have permissions of installing.

Figure 11.

Final Project ALL B2B<Company Name>, 2009 Page 18 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

During the installation we have to say to all the things “yes”. Then we will have a main part installed,
APACHE, PHP and MySQL with programs for handle them.
If all have been ok, we will have a program like next figure:

Figure 12.

We have to have the Apache and MySQL running.


After that we have to uncompress the package project.zip in the directory: C:\xampp\htdocs
Then we have to install the database, so we have to install the sql file in the MySQL server, if we don’t
know how to do it, we should follow the next tutorial.
• Open a web browser and type: http://localhost/
• After that, select your favorite language and select on the left phpMyAdmin

Figure 13.
• Then in phpMyAdmin you should import the file project.sql pushing on the right top on import:

Final Project ALL B2B<Company Name>, 2009 Page 19 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Figure 14.
• Then select the file and GO.

So, if there was no problem we have the system installed and we can work with it. In order to run the
program, we have to open again a web browser and type: http://localhost/proyecto/list_companies.php
After all, we will see a screen like that:

Figure 15.

15. User manual

This user manual will guide us using the features of the program.
First of all, have to open again a web browser and type: http://localhost/proyecto/list_companies.php
After all, we will see a screen like that:

Final Project ALL B2B<Company Name>, 2009 Page 20 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Figure 16.

Then we select for example the company BMW and we see the next screen:

Figure 17.

Now I’m going to describe each number:


1. Here you can see the private data, retrieved from the database.

Final Project ALL B2B<Company Name>, 2009 Page 21 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

2. Here you can update the private information.


3. Here you can go to see the products of the company.
4. You can see which products of other company have the same tags as the selected one.
5. Here you can see the public information. As we have said this is information retrieved from
internet in a different web pages using Google API.
6. Here we can see the address of the company.
7. If you make click here you can see the information related with the name of your company in the
map, in this case using Google Maps API.

Now we can see other characteristics of the system.

See products

If we click in number 3 we can see the products of the company with its tags, like the next screen:

Figure 18.
See products details

In this case we can see the details of a product, both public and private, and we can update the private
information.:

Final Project ALL B2B<Company Name>, 2009 Page 22 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Figure 19.
See tags

If we click in number 4 we can see the next screen. Here we have all the products related with the tag
selected.

Figure 20.

Final Project ALL B2B<Company Name>, 2009 Page 23 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

16. Implementation

The implementation of the system has some relevant aspects we should mention because we have used
some API on the internet that are not very common to use in an application. For these reason, firstly we
will comment normal source code and after the specific code of Google API.
16.1 PHP Code
We have used PHP code for almost all the programmatic aspects of the system. Next, there are some
examples.
For connecting to the database we use the file db_connection.php, where we select the database and the
user:
function connection()
{
$conexion = mysql_connect("localhost", "root", "");
mysql_select_db("project", $conexion) OR die ("pepe");

return $conexion;
}

In the file list_companies.php we list all the companies and we use the next code for connecting to the
database and get the private data:

include("includes/db_connection.php");

$conexion = connection();
$queEmp = "SELECT * FROM companies";
$resEmp = mysql_query($queEmp, $conexion) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);

In the next code we can see how we can get the rows of the data of the company, using the PHP methods
mysql_fetch_assoc, and others:

while ($rowEmp = mysql_fetch_assoc($resEmp))


{
$cadena_query='company.php?id='.$rowEmp['id'].'&CompanyName=' .
urlencode($rowEmp['CompanyName']) . '&CompanyAddress=' .
urlencode($rowEmp['CompanyAddress']);
Echo"<TR><TD><a
href=$cadena_query>".$rowEmp['CompanyName']."</a></TD><TD>".$rowEmp['Com
panyAddress']."</TD></TR>";
}

In the file compny.php, we can update the tags, and also we can update all the private information. Below
we have the code, where we use several tables of the database and SQL sentences:

$rowEmp = mysql_fetch_assoc($resEmp);
$id_tag = $rowEmp['id'];
$insert_tag = "INSERT INTO tags_company (id_company, id_tag)VALUES ('$id','$id_tag')";
$resEmp = mysql_query($insert_tag, $conexion) or die(mysql_error());

Final Project ALL B2B<Company Name>, 2009 Page 24 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

Now, in the next code we can see how the list of all the products with the same tag is made of. We also use
several tables:
$sql = "SELECT DISTINCT * FROM tag t, tags_products tp, companies c, products p WHERE
t.id=tp.id_tag AND t.name='".$tag."' AND c.id=tp.id_company AND tp.id_product=p.id ORDER
BY c.CompanyName;";

$resEmp = mysql_query($sql, $conexion) or die(mysql_error());


$totEmp = mysql_num_rows($resEmp);

echo
"<TR><TD></TD><TD>".$rowEmp['id_product']."</TD><TD>".$rowEmp['name']."</TD><TD
>".$rowEmp['description']."</TD></TR>";

16.2 Style

We have been using during the project CSS style sheets and it let us to divide the web page like we want.
We have a header, a middle part with right and left part, and also a footer using div. The next code is the
basic structure of the webpage. Thanks to some properties of CSS we could use this structure. The main
properties are float: right; and display:block;.

#right {
width: 315px;
float: right;
display:block;
margin-top: 10px;
}

#left {
width: 350px;
float:left;
display: block;
margin-left: 20px;
display: inline;
}

<body>
<div id="wrap">
<div id="top">
</div>
<div id="content">
<div id="left">
</div>
<div id="right">
</div>
<div id="clear">
</div>
</div>
<div id=”footer”>
</div>
</div>

Final Project ALL B2B<Company Name>, 2009 Page 25 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

16.3 Google API and JavaScript

As we said before, we have used Google API for getting the public data of the companies. This is one of
the most interesting things of the project because we use a external API to connect to other webpage and
have the results in our webpage, so it is very nice.
Some of the code is below. In the first one we get the information for the map and the second one in the
code for getting the information of the web pages.

function map(companyAddress, companyName) {


var hotspotsList =
[
{ element : document.getElementById("hs01"), query : companyName }
];

var options = {
zoomControl : GSmapSearchControl.ZOOM_CONTROL_ENABLE_ALL,
title : companyName,
url : "http://www.google.com/corporate/index.html",
idleMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM-5,
activeMapZoom : GSmapSearchControl.ACTIVE_MAP_ZOOM-5,
hotspots : hotspotsList
}
new GSmapSearchControl(
document.getElementById("mapsearch"),
companyAddress,
options

function onLoad()
{
var siteSearch1 = new google.search.WebSearch();
siteSearch1.setUserDefinedLabel("Alibaba.com");
siteSearch1.setSiteRestriction("alibaba.com");
var siteSearch2 = new google.search.WebSearch();
siteSearch2.setUserDefinedLabel("globalsources.com");
siteSearch2.setSiteRestriction("globalsources.com");

searchControl = new google.search.SearchControl();
searchControl.addSearcher(siteSearch1);
searchControl.addSearcher(siteSearch2);
searchControl.addSearcher(new google.search.WebSearch());

var options = new google.search.DrawOptions();


options.setDrawMode(GSearchControl.DRAW_MODE_TABBED);
searchControl.draw(document.getElementById("searchResults"), options);

var name = getValue("CompanyName");//we get the data by GET protocol


var address = getValue("CompanyAddress");
// Execute an inital search
searchControl.execute(name);
}

Final Project ALL B2B<Company Name>, 2009 Page 26 of 27


ALL B2B Version: 1.0
Software Architecture Document Date: 03/06/2009

17. References
[1] ThuyUyen H. Nguyen, Joseph S. Sherif, and Michael Newby, “Strategies for successful CRM implementation,” Information
Management & Computer Security Journal, vol.15, no.02,2007.
[2] Assion Lawson-Body, Abdou Illia, and Jeanne Jimenez, “Impact of data integration on CRM in the electronic commerce of SMEs,”
Academy of Information and Management Sciences Journal, 2006.
[3] Li, F. & H. Williams, “Interfirm collaboration through interfirm networks,” Information Systems Journal, 9, 1999, pp.103-115.
[4] Sathyan, J and Shenoy, K, “Realizing Unified Service Experience with SaaS on SOA,” Communication Systems Software and
Middleware and Workshops, 2008.
[5] Yan Liu, Qin Liu, Mingguang Zhuang and Qingling Wang, “An event-driven approach for E-Services System design,” 2008 4th
International Conference on Wireless Communications, Networking and Mobile Computing (WiCOM), 2008.
[6] Dan Ma, “The Business Model of “Software-As-A-Service”,” scc, IEEE International Conference on Services Computing (SCC
2007), pp. 701-702, 2007.
[7] J. Hagel III, Out of the Box, “Strategies for Achieving Profits Today and Growth Tomorrow through Web Services,” Harvard
Business School Press, Boston, MA, p. 15, 2002.
[8] Renate Eisentraut, Michael Koch, and Kathrin Möslein, “Building trust and reputation in communities and virtual enterprises,”
Proceedings of Americas Conference on Information Systems, 2001.
[9] Stephen Farrell, Tessa Lau, “Fringe Contacts: People-Tagging for the Enterprise,” IBM Research Report, computer science, June
30,2006.
[10] Biao Yu, Yan Liu, “A Service-Oriented CRM For SMEs Based On The Enterprise Level Customer”, School of Software Engineering,
Tongji University, Shanghai 200092, China

Final Project ALL B2B<Company Name>, 2009 Page 27 of 27

You might also like