3.3 Software Description
3.3 Software Description
2
Interestingly, in taking on the .NET vision, Microsoft seems to have given up
some of its proprietary tendencies (whereby all the technology it touched was warped
towards its Windows operating system). Because it sees its future as providing
software services in distributed applications, the .NET framework has been written so
that applications on other platforms will be able to access these services. For example,
.NET has been built upon open standard technologies like XML and SOAP.
At the development end of the .NET vision is the .NET Framework. This
contains the Common Language Runtime, the .NET Framework Classes, and higherlevel features like ASP.NET (the next generation of Active Server Pages technologies)
and Win Forms (for developing desktop applications).
The Common Language Runtime (CLR) manages the execution of code
compiled for the .NET platform. The CLR has two interesting features. Firstly, its
specification has been opened up so that it can be ported to non-Windows platforms.
Secondly, any number of different languages can be used to manipulate the .NET
framework classes, and the CLR will support them. This has led one commentator to
claim that under .NET the language one uses is a 'lifestyle choice'.
Not all of the supported languages fit entirely neatly into the .NET framework,
however (in some cases the fit has been somewhat Procrustean). But the one language
that is guaranteed to fit in perfectly is C#. This new language, a successor to C++, has
been released in conjunction with the .NET framework, and is likely to be the
language of choice for many developers working on .NET applications.
ADO .NET
Most applications need data access at one point of time making it a crucial
component when working with applications. Data access is making the application
interact with a database, where all the data is stored. Different applications have
different requirements for database access. VB .NET uses ADO .NET (Active X Data
Object) as it's data access and manipulation protocol which also enables us to work
with data on the Internet. Let's take a look why ADO .NET came into picture
replacing ADO.
Evolution of ADO.NET
The first data access model, DAO (data access model) was created for local
databases with the built-in Jet engine which had performance and functionality issues.
Next came RDO (Remote Data Object) and ADO (Active Data Object) which were
designed for Client Server architectures but soon ADO took over RDO. ADO was a
good architecture but as the language changes so is the technology. With ADO, all the
data is contained in a record set object which had problems when implemented on the
network and penetrating firewalls.
ADO was a connected data access, which means that when a connection to the
database is established the connection remains open until the application is closed.
Leaving the connection open for the lifetime of the application raises concerns about
database security and network traffic. Also, as databases are becoming increasingly
important and as they are serving more people, a connected data access model makes
us think about its productivity.
4
For example, an application with connected data access may do well when
connected to two clients, the same may do poorly when connected to 10 and might be
unusable when connected to 100 or more. Also, open database connections use system
resources to a maximum extent making the system performance less effective.
Why ADO.NET?
To cope up with some of the problems mentioned above, ADO .NET came
into existence. ADO .NET addresses the above mentioned problems by maintaining a
disconnected database access model which means, when an application interacts with
the database, the connection is opened to serve the request of the application and is
closed as soon as the request is completed.
Likewise, if a database is Updated, the connection is opened long enough to
complete the Update operation and is closed. By keeping connections open for only a
minimum period of time, ADO .NET conserves system resources and provides
maximum security for databases and also has less impact on system performance.
Also, ADO .NET when interacting with the database uses XML and converts all the
data into XML format for database related operations making them more efficient.
The ADO.NET Data Architecture
Data Access in ADO.NET relies on two components: DataSet and Data
Provider.
DataSet
The dataset is a disconnected, in-memory representation of data. It can be
considered as a local copy of the relevant portions of the database. The DataSet is
persisted in memory and the data in it can be manipulated and updated independent of
5
the database. When the use of this DataSet is finished, changes can be made back to
the central database for updating. The data in DataSet can be loaded from any valid
data source like Microsoft SQL server database, an Oracle database or from a
Microsoft Access database.
Data Provider
The Data Provider is responsible for providing and maintaining the connection
to the database. A DataProvider is a set of related components that work together to
provide data in an efficient and performance driven manner. The .NET Framework
currently comes with two DataProviders: the SQL Data Provider which is designed
only to work with Microsoft's SQL Server 7.0 or later and the OleDb DataProvider
which allows us to connect to other types of databases like Access and Oracle. Each
DataProvider consists of the following component classes;
The Connection object which provides a connection to the database.
The
Command
object
which
is
used
to
execute
command
The DataReader object which provides a forward-only, read only, connected recordset
The DataAdapter object which populates a disconnected DataSet with data and
performs update .
Data access with ADO.NET can be summarized as follows;
A connection object establishes the connection for the application with the
database. The command object provides direct execution of the command to the
database. If the command returns more than a single value, the command object
returns a DataReader to provide the data. Alternatively, the DataAdapter can be used
to fill the Dataset object. The database can be updated using the command object or
the DataAdapter.
ExecuteReader:
SelectCommand
InsertCommand
DeleteCommand
UpdateCommand
8
When the Update method is called, changes in the DataSet are copied back to
the database and the appropriate Insert Command, Delete Command, or Update
Command is executed.
HTML
This era of free information exchange has become possible only because of the
advent of the internet. The Internet enables computers around the world to be
connected together, thus providing a virtual library of several documents.
Hyper Text Markup Language (HTML) provides the facilities required to link
several related documents already stored on computers or to easily move within a
single document. Hypertext refers to the content of the document that includes text,
pictures, videos, flash components and even provides links to other related documents
and web sites, hence it enables the browser to display the document attractively thus
making it less boring for the users. This set of linked documents in known as the
World Wide Web (WWW).
HTML was first conceived by a researcher named Tim Berners Lee in 1989. It
became very popular soon after it advent and almost completely replaced its
predecessor Gopher. HTML file is a text file containing small markup tags. These text
files can be created using any simple text editor and there are also several software
packages available in the market that helps to create HTML documents. These
software packages automatically convert the text into HTML code and one of the
most popular and widely used software for this purpose is FrontPage.
The markup tags are those that instruct the browser on how to display the
document. The browser uses these tags to decide what to do with the contents of the
document. A tag consists of key words enclosed within angled brackets (< >).The key
word indicates the function of the tag. The Tags in the HTML document are not case
sensitive. However the latest web standards specify the usage of lowercase tags. The
World Wide Web Consortium (W3C) recommends lowercase tags in their HTML 4
recommendation, and XHTML (the next generation HTML) demands lowercase tags.
9
Most tags come in pairs. The first tag is called the start tag and indicates the
beginning of an effect. The second tag is called the end tag and indicates the end of an
effect. The end tags are usually the same as the start tags except that they have a / in
front of the key word. A simple example being <B> and </B>. The text between the
start and the end tags is known as the element content.
Tags can have attributes. Attributes provide additional information to an
HTML element. Attributes always come in name/value pairs like this: name="value".
Attributes are always specified in the start tag of an HTML element.
Structure Of An HTML Document:
Every HTML document begins with the <HTML> tag. This tag indicates that
what follows in an HTML document. The <HTML> is followed by two sections
Head Section
Body Section
Head Section is used to specify the title of the document. It begins with the
<Head> tag. This is followed by the <Title> tag which in turn is followed by the title
of the document which will be displayed in the title bar of the browser. The title ends
with the </Title> end tag. To end the head section, the </Head> tag is used.
Body Section contains the document itself and begins with the <Body> tag,
followed by the text of the document and ends with the </Body> end tag. The last line
of the HTML document is the </Html> end tag that indicates the end of the HTML
document. During the nesting of tags, the inner tag should be completely nested
within the outer tag.
Protocol layer
Protocol layer implements the external interface to SQL Server. All operations
that can be invoked on SQL Server are communicated to it via a Microsoft-defined
format, called Tabular Data Stream (TDS). TDS is an application layer protocol, used
to transfer data between a database server and a client. Initially designed and
developed by Sybase Inc. for their Sybase SQL Server relational database engine in
10
1984, and later by Microsoft in Microsoft SQL Server, TDS packets can be encased in
other physical transport dependent protocols, including TCP/IP, Named pipes, and
Shared memory. Consequently, access to SQL Server is available over these protocols.
In addition, the SQL Server API is also exposed over bando web services.
Data storage
The main unit of data storage is a database, which is a collection of tables with
typed columns. SQL Server supports different data types, including primary types
such as Integer, Float, Decimal, Char (including character strings), Varchar (variable
length character strings), binary (for unstructured blobs of data), Text (for textual data)
among others. It also allows user-defined composite types (UDTs) to be defined and
used. SQL Server also makes server statistics available as virtual tables and views
(called Dynamic Management Views or DMVs). A database can also contain other
objects including views, stored procedures, indexes and constraints, in addition to
tables, along with a transaction log.
A SQL Server database can contain a maximum of 231 objects, and can span
multiple OS-level files with a maximum file size of 220 TB. The data in the database
are stored in primary data files with an extension .mdf. Secondary data files, identified
with an .ndf extension, are used to store optional metadata. Log files are identified
with the .ldf extension.
Storage space allocated to a database is divided into sequentially numbered
pages, each 8 KB in size. A page is the basic unit of I/O for SQL Server operations. A
page is marked with a 96-byte header which stores metadata about the page including
the page number, page type, free space on the page and the ID of the object that owns
it.
Page type defines the data contained in the page - data stored in the database,
index, allocation map which holds information about how pages are allocated to
tables and indexes, change map which holds information about the changes made to
other pages since last backup or logging, or contain large data types such as image or
text. While page is the basic unit of an I/O operation, space is actually managed in
terms of an extent which consists of 8 pages.
11
A database object can either span all 8 pages in an extent ("uniform extent")
or share an extent with up to 7 more objects ("mixed extent"). A row in a database
table cannot span more than one page, so is limited to 8 KB in size. However, if the
data exceeds 8 KB and the row contains Varchar or Varbinary data, the data in those
columns are moved to a new page (or possible a sequence of pages, called Allocation
unit) and replaced with a pointer to the data.
For physical storage of a table, its rows are divided into a series of partitions
(numbered 1 to n). The partition size is user defined; by default all rows are in a single
partition. A table is split into multiple partitions in order to spread a database over a
cluster. Rows in each partition are stored in either B-tree or heap structure. If the table
has an associated index to allow fast retrieval of rows, the rows are stored in-order
according to their index values, with a B-tree providing the index. The data is in the
leaf node of the leaves, and other nodes storing the index values for the leaf data
reachable from the respective nodes. If the index is non-clustered, the rows are not
sorted according to the index keys. An indexed view has the same storage structure as
an indexed table. A table without an index is stored in an unordered heap structure.
Both heaps and B-trees can span multiple allocation units.
Buffer management
SQL Server buffers pages in RAM to minimize disc I/O. Any 8 KB page can
be buffered in-memory, and the set of all pages currently buffered is called the buffer
cache. The amount of memory available to SQL Server decides how many pages will
be cached in memory. The buffer cache is managed by the Buffer Manager. Either
reading from or writing to any page copies it to the buffer cache. Subsequent reads or
writes are redirected to the in-memory copy, rather than the on-disc version.
The page is updated on the disc by the Buffer Manager only if the in-memory
cache has not been referenced for some time. While writing pages back to disc,
asynchronous I/O is used whereby the I/O operation is done in a background thread so
that other operations do not have to wait for the I/O operation to complete. Each page
is written along with its checksum when it is written. When reading the page back, its
checksum is computed again and matched with the stored version to ensure the page
has not been damaged or tampered with in the mean time.
12
13
14
SQL Server also provides the optimistic concurrency control mechanism,
which is similar to the multiversion concurrency control used in other databases. The
mechanism allows a new version of a row to be created whenever the row is updated,
as opposed to overwriting the row, i.e., a row is additionally identified by the ID of
the transaction that created the version of the row.
Both the old as well as the new versions of the row are stored and maintained,
though the old versions are moved out of the database into a system database
identified as Tempdb. When a row is in the process of being updated, any other
requests are not blocked (unlike locking) but are executed on the older version of the
row. If the other request is an update statement, it will result in two different versions
of the rows - both of them will be stored by the database, identified by their respective
transaction IDs.
Data retrieval
The main mode of retrieving data from an SQL Server database is querying for
it. The query is expressed using a variant of SQL called T-SQL, a dialect Microsoft
SQL Server shares with Sybase SQL Server due to its legacy. The query declaratively
specifies what is to be retrieved. It is processed by the query processor, which figures
out the sequence of steps that will be necessary to retrieve the requested data. The
sequence of actions necessary to execute a query is called a query plan. There might
be multiple ways to process the same query.
For example, for a query that contains a join statement and a select statement,
executing join on both the tables and then executing select on the results would give
the same result as selecting from each table and then executing the join, but result in
different execution plans. In such case, SQL Server chooses the plan that is supposed
to yield the results in the shortest possible time. This is called query optimization and
is performed by the query processor itself.
SQL Server includes a cost-based query optimizer which tries to optimize on
the cost, in terms of the resources it will take to execute the query. Given a query, the
query optimizer looks at the database schema, the database statistics and the system
load at that time. It then decides which sequence to access the tables referred in the
query, which sequence to execute the operations and what access method to be used to
15
access the tables. For example, if the table has an associated index, whether the index
should be used or not - if the index is on a column which is not unique for most of the
columns (low "selectivity"), it might not be worthwhile to use the index to access the
data.
Finally, it decides whether to execute the query concurrently or not. While a
concurrent execution is more costly in terms of total processor time, because the
execution is actually split to different processors might mean it will execute faster.
Once a query plan is generated for a query, it is temporarily cached. For further
invocations of the same query, the cached plan is used. Unused plans are discarded
after some time.
SQL Server also allows stored procedures to be defined. Stored procedures are
parameterized T-SQL queries that are stored in the server itself (and not issued by the
client application as is the case with general queries). Stored procedures can accept
values sent by the client as input parameters, and send back results as output
parameters. They can also call other stored procedures, and can be selectively
provided access to.
Unlike other queries, stored procedures have an associated name, which is
used at runtime to resolve into the actual queries. Also because the code need not be
sent from the client every time (as it can be accessed by name), it reduces network
traffic and somewhat improves performance. Execution plans for stored procedures
are also cached as necessary.
SQL CLR
Microsoft SQL Server 2005 includes a component named SQL CLR via
which it integrates with .NET Framework. Unlike most other applications that use
.NET Framework, SQL Server itself hosts the .NET Framework runtime, i.e.,
memory, threading and resource management requirements of .NET Framework are
satisfied by SQLOS itself, rather than the underlying Windows operating system.
SQLOS provides deadlock detection and resolution services for .NET code as well.
With SQL CLR, stored procedures and triggers can be written in any managed .NET
language, including C# and VB.NET.
16
Managed code can also be used to define UDTs which can be persisted in the
database. Managed code is compiled to .Net assemblies and after being verified for
type safety, registered at the database. After that, they can be invoked like any other
procedure. However, only a subset of the Base Class Library is available, when
running code under SQL CLR. Most APIs relating to user interface functionality are
not available.
When writing code for SQL CLR, data stored in SQL Server databases can be
accessed using the ADO.NET APIs like any other managed application that accesses
SQL Server data. However, doing that creates a new database session, different from
the one in which the code is executing. To avoid this, SQL Server provides some
enhancements to the ADO.NET provider that allows the connection to be redirected to
the same session which already hosts the running code. Such connections are called
context connections and are set by setting context connection parameter to true in the
connection string.
SQL Server also provides several other enhancements to the ADO.NET API,
including classes to work with tabular data or a single row of data as well as classes to
work with internal metadata about the data stored in the database. It also provides
access to the XML features in SQL Server, including XQuery support. These
enhancements are also available in T-SQL Procedures in consequence of the
introduction of the new XML Datatype (query, value, nodes functions).
Services
SQL Server also includes an assortment of add-on services. While these are
not essential for the operation of the database system, these provide value added
services on top of the core database management system. These services either run as
a part of some SQL Server component or out-of-process as Windows Service and
presents their own API to control and interact with them.
Service Broker
The Service Broker, which runs as a part of the database engine, provides a
reliable messaging and message queuing platform for SQL Server applications. Used
inside an instance, it is used to provide an asynchronous programming environment.
17
For cross instance applications, Service Broker communicates over TCP/IP and
allows the different components to be synchronized together, via exchange of
messages.
Replication Services
SQL Server Replication Services are used by SQL Server to replicate and
synchronize database objects, either in entirety or a subset of the objects present,
across replication agents, which might be other database servers across the network,
or database caches on the client side.
Replication follows a publisher/subscriber model, i.e., the changes are sent out
by one database server ("publisher") and are received by others ("subscribers"). SQL
Server supports three different types of replication:
Transaction replication
Each transaction made to the publisher database (master database) is synced
out to subscribers, who update their databases with the transaction. Transactional
replication synchronizes databases in near real time.
Merge replication
Changes made at both the publisher and subscriber databases are tracked, and
periodically the changes are synchronized bi-directionally between the publisher and
the subscribers. If the same data has been modified differently in both the publisher
and the subscriber databases, synchronization will result in a conflict which has to be
resolved - either manually or by using pre-defined policies.
Snapshot replication
Snapshot replication published a copy of the entire database (the then-snapshot
of the data) and replicates out to the subscribers. Further changes to the snapshot are
not tracked.
18
Analysis Services
SQL Server Analysis Services adds OLAP and data mining capabilities for
SQL Server databases. The OLAP engine supports MOLAP, ROLAP and HOLAP
storage modes for data. Analysis Services supports the XML for Analysis standard as
the underlying communication protocol. The cube data can be accessed using MDX
queries.
Data mining specific functionality is exposed via the DMX query language.
Analysis Services includes various algorithms Decision trees, clustering algorithm,
Nave Bayes algorithm, time series analysis, sequence clustering algorithm, linear and
logistic regression analysis, and neural networks - for use in data mining.
Reporting Services
SQL Server Reporting Services is a report generation environment for data
gathered from SQL Server databases. It is administered via a web interface. Reporting
services features a web services interface to support the development of custom
reporting applications. Reports are created as RDL files.
Reports can be designed using recent versions of Microsoft Visual Studio
(including Visual Studio.NET 2003 onwards) with Business Intelligence Development
Studio, installed or with the included Report Builder. Once created, RDL files can be
rendered in a variety of formats including Excel, PDF, CSV, XML, TIFF (and other
image formats), and HTML Web Archive.
Notification Services
Introduced and available only with Sql Server 2005, SQL Server Notification
Services is a platform for generating notifications, which are sent to Notification
Services subscribers. A subscriber registers for a specific event or transaction (which
is registered on the database server as a trigger); when the event occurs, Notification
Services uses Service Broker to send a message to the subscriber informing about the
occurrence of the event.
19
Integration Services
SQL Server Integration Services is used to integrate data from different data
sources. It is used for the ETL capabilities for SQL Server for data warehousing
needs. Integration Services includes GUI tools to build data extraction workflows
integration various functionality such as extracting data from various sources,
querying data, transforming data including aggregating, duplication and merging data,
and then loading the transformed data onto other sources, or sending e-mails detailing
the status of the operation.
Full Text Search Service
20
also supported, i.e., if the words searched for do not occur in the sequence they are
specified in the query but are near each other, they are also considered a match. TSQL exposes special operators that can be used to access the FTS capabilities.
The Full Text Search engine is divided into two processes - the Filter Daemon
process (msftefd.exe) and the Search process (msftesql.exe). These processes interact
with the SQL Server. The Search process includes the indexer (that creates the full
text indexes) and the full text query processor.
The indexer scans through text columns in the database. It can also index
through binary columns, and use iFilters to extract meaningful text from the binary
blob (for example, when a Microsoft Word document is stored as an unstructured
binary file in a database).
The iFilters are hosted by the Filter Daemon process. Once the text is
extracted, the Filter Daemon process breaks it up into a sequence of words and hands
it over to the indexer. The indexer filters out noise words, i.e., words like A, And etc,
which occur frequently and are not useful for search. With the remaining words, an
inverted index is created, associating each word with the columns they were found in.
SQL Server itself includes a Gatherer component that monitors changes to tables and
invokes the indexer in case of updates.
When a full text query is received by the SQL Server query processor, it is
handed over to the FTS query processor in the Search process. The FTS query
processor breaks up the query into the constituent words, filters out the noise words,
and uses an inbuilt thesaurus to find out the linguistic variants for each word. The
words are then queried against the inverted index and a rank of their accurateness is
computed. The results are returned to the client via the SQL Server process.
21
4. SYSTEM DESIGN
4.1
INPUT DESIGN
Input design is the link between the information system and the users and
those steps that are necessary to put transaction data in to a usable form for
processing data entry. The activity of putting data into the computer for processing
can be activated by instructing the computer to read data from a written printed
document or it can occur by keying data directly into the system. The designs of
input focusing on controlling the amount of input required controlling the errors,
avoid delay extra steps, and keeping the process simple.
System analyst decides the following input design details
The dialogue to guide the users in providing input.
which enable the customer, CSR, QA and Administrator to operate the application
with ease of use. The Input forms are highly designed with data validation, data
integration and consistency with databases and application logic.
The users are directed with standard messages and alerts which enables
them to feed the data with accuracy. It also provides short keys which make the
feeding of data much simpler and easier. OBSE provides Login input form which
enables the user to access the application based on the access rights.
The application accepts user input and generates the respective action
object which is passed to the respective input forms. The input enables the CSR to
access a single complaint details at a time. The CSR provides solution of the
complaint which is fed in the respective tables.
22
4.2 OUTPUT DESIGN
On receiving the request from client the server sends the response to
client. A website runs over web server that is the server software behind the World
Wide Web. It listens for requests from a client, such as a browser like Netscape or
Microsoft internet explorer, when it gets one, it processes that request and returns
some data. This data usually takes the form of a formatted page with text and
graphics. The various output forms are:
DATABASE DESIGN
The database component of MS-SQL is a Structured Query
Ensuring that data is stored correctly and that the rules defining data
relationships are not violated.
23
Level 1
admin
.Add Product
Product
Details
Edit&Update
Product
Report
Level 2
Product
Product Entry
Purchase
Purchas
e
Purchase
Entry
Purchase
Return
24
Sales
Sales
Sales Return
Bill Details
Stock
Stock
Information of Stock
Report
Report
Purchase
Details
Sales
Return
Stock
25
Mobile
shop
Customer Login
Owner Login
Level2:Customer
Login
Register
Product
details
Order
details
Bill
details
26