Beruflich Dokumente
Kultur Dokumente
Y9MC93007
INTRODUCTION
PEER-TO-PEER (P2P) networks have become very popular in the last few years. Nowadays, they are the most widespread approach for exchanging data among large communities of users in the file sharing context. In this scenario, the success of P2P-based solutions is strictly related to the use of lossy data compression techniques (such as MPEG formats), which yield reasonable detail levels in representing large amounts of information and make data exchange feasible in practice by significantly reducing data transmission costs. However, the problem of suitably extending-data-compression-based solutions to application contexts other than file sharing has not been deeply investigated yet. Specifically, no P2P-based solution has imposed itself as an effective evolution of traditional distributed databases. This is quite surprising, as the huge amount of resources provided by P2P networks (in terms of storage capacity, computing power, and data transmission capability) could effectively support data management. In this scenario, information is represented as points in a multidimensional space whose dimensions correspond to different perspectives over data: users explore data and retrieve aggregates by issuing range queries, i.e., queries specifying an aggregate operator and the range of the data domain from which the aggregate information should be retrieved. Specifically, we will consider the case of analytical applications dealing with historical data, which typically require huge computation and storage capabilities, due to the large amount of data which need to be accessed to evaluate queries. Although the multidimensional data model is substantially more complex than the representation paradigm adopted in the file sharing context (where data are organized according to hname; filei pairs), analytical applications dealing with historical multidimensional data and file-sharing applications share a fundamental aspect: they can rely on lossy data compression. In fact, analogously to tools for reproducing audio and/or video files, a lot of applications dealing with multidimensional data can effectively accomplish their tasks even in the case that only an approximate representation of data is available
ABSTRACT:
SIDDHARTH INSTITUTE OF PG STUDIES Page | 2
Y9MC93007
multidimensional data is proposed, which provides efficient and robust query evaluation. When a data population is published, data are summarized in a synopsis, consisting of an index built on top of a set of subsynopses (storing compressed representations of distinct data portions). The index and the subsynopses are distributed across the network, and suitable replication mechanisms taking into account the query workload and network conditions are employed that provide the appropriate coverage for both the index and the subsynopses. Index Terms P2P networks, multidimensional data management, data compression. OBJECTIVES: P2P, is any distributed network architecture composed of participants that make a portion of their resources (such as processing power, disk storage or network bandwidth) directly available to other network participants. Description : Our aim is devising a P2P-based framework supporting the analysis of multidimensional historical data. Specifically, our efforts will be devoted to combining the amenities of P2P networks and data compression to provide a support for the evaluation of range queries, possibly trading off efficiency with accuracy of answers. The framework should enable members of an organization to cooperate by sharing their resources (both storage and computational) to host (compressed) data and perform aggregate queries on them, while preserving their autonomy. A framework with these characteristics can be useful in different application contexts. For instance, consider the case of a worldwide virtual organization with users interested in geographical data, as well as the case of a real organization on an enterprise network. In both cases, even users who are not continuously interested in performing data analysis can make a\part of their resources available for supporting analysis tasks needed by others, if their own capability of performing local tasks is preserved. 1.1.1 Challenges
SIDDHARTH INSTITUTE OF PG STUDIES Page | 3
Y9MC93007
The management of compressed data on unstructured P2P networks is an intriguing issue, but poses several research challenges, which we discuss in the following. 1.1.1.1 Compression A compression technique must be devised which is able to create prone-to-bedistributed data synopses supporting the efficient evaluation of aggregates, possibly affected by tolerable error rates. Several compression techniques have been proposed in the literature in the centralized scenario, which are able to compute synopses that enable aggregate queries to be estimated with very good accuracy. These techniques could be employed in the P2P scenario to build a single synopsis to be replicated over the network. However, in this case, . although the cost of disk storage is continuously and rapidly decreasing, it may still be difficult to find peers for which hosting replicas of synopses has a negligible cost, while autonomy is a requirement in our setting: using traditional compression techniques, synopses providing reasonable error rates may have a non-negligible size (usually not under 1 percent of the size of the original data set, e.g., 100 GB from a 10 TB data set). . although compressing the data certainly makes replication less resource consuming, replicating the entire synopsis each time would require storage and network resources that could be saved if only some specific portion of the synopsis could be replicated. These drawbacks would be overcome if the compressed synopsis were subdivided into tiny subsynopses which are independently replicated and disseminated on the network when needed. Peers would, therefore, be asked to host replicas of small chunks of data. This way, the autonomy requirement would not result in a limit on the overall size of the synopsis (since the whole storage capacity of the network could be employed to store the whole synopsis), thus enabling the construction of synopses that provide high-quality estimates. In fact, it is well known that the naive solution of obtaining independent subsynopses by first partitioning the data and then compressing each portion separately is less effective than compressing the data altogether. This is analogous to what generally happens with common lossless compression algorithms, such as LZW [43]: compressing n pieces of a text separately results in n independent synopses whose overall size is larger than the synopsis obtained by compressing the whole text. 1.1.1.2 Indexing Once a compression technique yielding subsynopses with the desired properties has been defined, the problem of making the compressed data efficient to be located over the network
SIDDHARTH INSTITUTE OF PG STUDIES Page | 4
Y9MC93007
must be tackled. Appropriate techniques are thus needed to distribute the compressed data and index them for efficient access. In unstructured P2P systems, no indexing mechanism is generally provided, and data accessibility is achieved by disseminating replicas. Thus, users explore the network (through flooding or random walking) until the desired data are located. This approach could be adapted to our context by simply disseminating several copies of all the subsynopses; however, this way, answering a range query could require several subsynopses to be located, thus making query evaluation bandwidth-consuming. A better way to address this issue is to design an indexing mechanism that supports the efficient location of the subsynopses involved in the query evaluation Hence, the challenge is to define an indexing technique supporting the location of our subsynopses in an unstructured network, such that the portions of the index and the responsibility of hosting it can be dynamically distributed among the peers, while preserving their autonomy. 1.1.1.3 Replication A replication scheme capable of maintaining appropriate levels of coverage w.r.t. the evolution of user interests and network conditions must be designed, to ensure accessibility and robustness. Existing replication strategies for unstructured P2P networks treat data sets as atomic objects, as they perform a number of replicas of a data set each time a query is posed on it. As explained before, in our scenario, this would limit both the size of the synopsis (thus affecting the accuracy of the compressed data) and the frequency of replica creations (thus limiting the responsiveness w.r.t. volatility); moreover, the index itself must be properly replicated too. Hence, the challenge is to exploit the fragmentation of the synopsis and the multidimensionality of data to detect the specific portions of data and index which need to be replicated, that is, the regions of the data in which users are interested most or whose accessibility is not satisfactory, as well as the portions of the index referencing these regions. Based on this, a fine-grained replication strategy must be devised which, instead of blindly creating replicas of the whole synopsis, makes new copies of specific portions of data and index when needed.
Y9MC93007
Y9MC93007
Requirements Analysis is done in order to understand the problem for which the software system is to solve. For example, the problem could be automating an existing manual process, or developing a completely new automated system, or a combination of the two. For large systems which have a large number of features, and that need to perform many different tasks, understanding the requirements of the system is a major task. The emphasis in requirements Analysis is on identifying what is needed from the system and not how the system will achieve it goals. This SIDDHARTH INSTITUTE OF PG STUDIES Page | 7
Y9MC93007
task is complicated by the fact that there are often at least two parties involved in software development - a client and a developer. The developer usually does not understand the client's problem domain, and the client often does not understand the issues involved in software systems. This causes a communication gap, which has to be adequately bridged during requirements Analysis. In most software projects, the requirement phase ends with a document describing all the requirements. In other words, the goal of the requirement specification phase is to produce the software requirement specification document. The person responsible for the requirement analysis is often called the analyst. There are two major activities in this phase - problem understanding or analysis and requirement specification in problem analysis; the analyst has to understand the problem and its context. Such analysis typically requires a thorough understanding of the existing system, the parts of which must be automated. Once the problem is analyzed and the essentials understood, the requirements must be specified in the requirement specification document. For requirement specification in the form of document, some specification language has to be selected (example: English, regular expressions, tables, or a combination of these). The requirements documents must specify all functional and performance requirements, the formats of inputs, outputs and any required standards, and all design constraints that exits due to political, economic environmental, and security reasons. The phase ends with validation of requirements specified in the document. The basic purpose of validation is to make sure that the requirements specified in the document, actually reflect the actual requirements or needs, and that all requirements are specified. Validation is often done through requirement review, in which a group of people including representatives of the client, critically review the requirements specification.
Y9MC93007
2. A condition or capability that must be met or possessed by a system to satisfy a contract, standard, specification, or other formally imposed document.
Note that in software requirements we are dealing with the requirements of the proposed system, that is, the capabilities that system, which is yet to be developed, should have. It is because we are dealing with specifying a system that does not exist in any form that the problem of requirements becomes complicated. Regardless of how the requirements phase proceeds, the Software Requirement Specification (SRS) is a document that completely describes what the proposed software should do without describing how the system will do it?. The basic goal of the requirement phase is to produce the Software Requirement Specification (SRS), which describes the complete external behavior of the proposed software.
Existing System
In Existing system the multidimensional data model is substantially more complex than the representation paradigm adopted in the file sharing context (where data are organized according to (name; file pairs), analytical applications dealing with historical multidimensional data and file-sharing applications share a fundamental aspect: they can rely on lossy data compression.
In the case of analytical applications dealing with historical data, which typically require huge computation and storage capabilities, due to the large amount of data which need to be accessed to evaluate queries. However, the problem is suitably extending-data-compression-based solutions to application contexts other than file sharing has not been deeply investigated yet. The tools for reproducing audio and/or video files, a lot of applications dealing with multidimensional data can effectively accomplish their tasks even in the case that only an approximate representation of data is available
Proposed System
We proposed a framework for sharing and performing analytical queries on historical multidimensional data in unstructured peer-to-peer networks.
Y9MC93007
In our approach, participants make their resources (and possibly their data in a suitable compressed format) available for the other peers in exchange for the possibility of accessing and posing range queries against the data published by others. Our solution is based on suitable data summarization and indexing techniques, and on mechanisms for data distribution and replication that properly take into account the need of preserving the autonomy of peers as well as the interest exhibited by the users in the data to support an efficient query evaluation. The experimental results showed the effectiveness of our approach in providing fast and accurate query answers, and ensuring the robustness that is mandatory in peer-to-peer settings. .
Modules Explanation
Our proposal is a framework supporting the sharing and the analysis of compressed historical multidimensional data over an unstructured P2P network. From the user standpoint, two tasks are supported: data publication and data querying. Data Publication Let p be a peer which is willing to share a historical multidimensional data set D so that the other peers can pose aggregate range queries against it. In order to make its data suitable for being distributed across the network, p builds a synopsis of D by first appropriately partitioning D, and then, compressing each portion of data in the partition. Peer p also builds an index over these subsynopses, which, again, is properly fragmented in order to make it prone to be distributed. Finally, the subsynopses and the index portions are disseminated across the network, along with metadata about D. The assignment of data and index portions to peers takes into account the willingness of peers to share their resources. Data Querying Exploration queries can be issued by peers to discover the shared data sets in which they may be interested. These queries specify criteria that are matched against the metadata associated with each available data set. The result of the exploration process is a set of matching data sets
SIDDHARTH INSTITUTE OF PG STUDIES Page | 10
Y9MC93007
and for each of them, a set of peers that should be contacted to start the evaluation of range queries, i.e., peers hosting portions of the distributed index that are thus capable to appropriately route range queries. The main contributions of this paper and its organization may be summed up as follows: 1. a compression technique for building an indexed aggregate structure over a multidimensional data population, prone to be distributed, and accessed across a P2P network. 2. a storage model which employs additional data structures to support efficient and robust query answering over compressed data in an unstructured P2P network. 3. a dynamic replication scheme capable of maintaining appropriate levels of coverage w.r.t. the evolution of the query workload and the network condition. Partitioning the Data Domain The aim of the partitioning step is to divide the data domain into nonoverlapping blocks. These blocks will be compressed separately, yielding distinct subsynopses. The assignment of different amounts of storage space to the blocks for representing their subsynopses should depend on the differences in homogeneity among the blocks. Intuitively enough, the more homogeneous the data inside a block, the smaller the amount of information needed to effectively accomplish its summarization.
Splitting Blocks of the Partition Hence, employing this splitting strategy aims at creating blocks with similar degrees of homogeneity, while refining the partition toward more and more homogeneous blocks. Specifically, having blocks with similar homogeneity is likely to yield subsynopses with similar accuracy, while having blocks as much homogeneous as possible is likely to enhance the accuracy of each subsynopsis. 2.1.2 Distributing Blocks of the Current Partition
SIDDHARTH INSTITUTE OF PG STUDIES Page | 11
Y9MC93007
First, a fixed portion Bmin of B is assigned to every block (the meaning of Bmin will be clearer in the following), and then, the remainder of B is distributed on the basis of the homogeneity of the blocks. That is, if the current partition consists of k blocks b1; . . . ; bk, then
each bi is assigned the following amount of storage space: block according to the compression technique adopted
The value of Bmin is the amount of space needed to store the most compact representation of a
Y9MC93007
Feasibility Study
The feasibility of the project is analyzed in this phase and business proposal is put fortwith a very general plan for the project and some cost estimates. During system analysis the feasibility study of the proposed system is to be carried out. This is to ensure that the proposed system is not a burden to the company. For feasibility analysis, some understanding of the major requirements for the system is essential.
SIDDHARTH INSTITUTE OF PG STUDIES Page | 13
Y9MC93007
ECONOMICAL FEASIBILITY This study is carried out to check the economic impact that the system will have on the organization. The amount of fund that the company can pour into the research and development of the system is limited. The expenditures must be justified. Thus the developed system as well within the budget and this was achieved because most of the technologies used are freely available. Only the customized products had to be purchased. TECHNICAL FEASIBILITY This study is carried out to check the technical feasibility, that is, the technical requirements of the system. Any system developed must not have a high demand on the available technical resources. This will lead to high demands on the available technical resources. This will lead to high demands being placed on the client. The developed system must have a modest requirement, as only minimal or null changes are required for implementing this system.
SOCIAL FEASIBILITY The aspect of study is to check the level of acceptance of the system by the user. This includes the process of training the user to use the system efficiently. The user must not feel threatened by the system, instead must accept it as a necessity. The level of acceptance by the users solely depends on the methods that are employed to educate the user about the system and
Y9MC93007
to make him familiar with it. His level of confidence must be raised so that he is also able to make some constructive criticism, which is welcomed, as he is the final user of the system.
Y9MC93007
SPIRAL MODEL
SPIRAL MODEL was defined by Barry Boehm in his 1988 article, A spiral Model of Software Development and Enhancement. This model was not the first model to SIDDHARTH INSTITUTE OF PG STUDIES Page | 16
Y9MC93007
discuss iterative development, but it was the first model to explain why the iteration models. As originally envisioned, the iterations were typically 6 months to 2 years long. Each phase starts with a design goal and ends with a client reviewing the progress thus far. Analysis and engineering efforts are applied at each phase of
the project, with an eye toward the end goal of the project. The steps for Spiral Model can be generalized as follows:
possible. This usually involves interviewing a number of users representing all the external or internal users and other aspects of the existing system.
A preliminary design is created for the new system. A first prototype of the new system is constructed from the preliminary
design. This is usually a scaled-down system, and represents an approximation of the characteristics of the final product.
A second prototype is evolved by a fourfold procedure: Evaluating the first prototype in terms of its strengths, weakness, and risks. Defining the requirements of the second prototype. Planning an designing the second prototype. Constructing and testing the second prototype.
At the customer option, the entire project can be aborted if the risk is deemed too great. Risk factors might involve development cost overruns, operating-cost miscalculation, or any other factor that could, in the customers judgment, result in a less-than-satisfactory final product.
Y9MC93007
The existing prototype is evaluated in the same manner as was the previous prototype, and if necessary, another prototype is developed from it according to the fourfold procedure outlined above.
The preceding steps are iterated until the customer is satisfied that the refined prototype represents the final product desired.
The final system is constructed, based on the refined prototype. The final system is thoroughly evaluated and tested. Routine
maintenance is carried on a continuing basis to prevent large scale failures and to minimize down time.
Y9MC93007
Y9MC93007
ADVANTAGES:
Estimates(i.e. budget, schedule etc .) become more relistic as work progresses, because important issues discoved earlier. It is more able to cope with the changes that are software development generally entails.
You are now ready to edit, run, and compile the project with DJava..
Y9MC93007
Investigate implementation alternativesnamely design, reuse, procure, and procure/ modify. Investigate constraints imposed on the alternativesnamely technology, cost, schedule, support, and risk. Once the system or products objectives, alternatives, and constraints are understood, Quadrant 2 (Evaluate alternatives, identify, and resolve risks) is performed.
Y9MC93007
Y9MC93007
Y9MC93007
HARDWARE CONFIGURATION
: : : :
SOFTWARE CONFIGURATION
: : : :
Y9MC93007
Y9MC93007
JAVA TECHNOLOGY
Java technology is both a programming language and a platform.
Simple Architecture neutral Object oriented Portable Distributed High performance Interpreted Multithreaded Robust Dynamic Secure
With most programming languages, you either compile or interpret a program so that you can run it on your computer. The Java programming language is unusual in that a program is both compiled and interpreted. With the compiler, first you translate a program into an intermediate language called Java byte codes the platform-independent codes interpreted by the interpreter on the Java platform. The interpreter parses and runs each Java byte code
SIDDHARTH INSTITUTE OF PG STUDIES Page | 26
Y9MC93007
instruction on the computer. Compilation happens just once; interpretation occurs each time the program is executed. The following figure illustrates how this works.
You can think of Java byte codes as the machine code instructions for the Java Virtual Machine (Java VM). Every Java interpreter, whether its a development tool or a Web browser that can run applets, is an implementation of the Java VM. Java byte codes help make write once, run anywhere possible. You can compile your program into byte codes on any platform that has a Java compiler. The byte codes can then be run on any implementation of the Java VM. That means that as long as a computer has a Java VM, the same program written in the Java programming language can run on Windows 2000, a Solaris workstation, or on an iMac.
Y9MC93007
Weve already mentioned some of the most popular platforms like Windows 2000, Linux, Solaris, and MacOS. Most platforms can be described as a combination of the operating system and hardware. The Java platform differs from most other platforms in that its a software-only platform that runs on top of other hardware-based platforms. The Java platform has two components:
The Java Virtual Machine (Java VM) The Java Application Programming Interface (Java API)
Youve already been introduced to the Java VM. Its the base for the Java platform and is ported onto various hardware-based platforms. The Java API is a large collection of ready-made software components that provide many useful capabilities, such as graphical user interface (GUI) widgets. The Java API is grouped into libraries of related classes and interfaces; these libraries are known as packages. The next section, What Can Java Technology Do? Highlights what functionality some of the packages in the Java API provide. The following figure depicts a program thats running on the Java platform. As the figure shows, the Java API and the virtual machine insulate the program from the hardware.
Native code is code that after you compile it, the compiled code runs on a specific hardware platform. As a platform-independent environment, the Java platform can be a bit slower than native code. However, smart compilers, well-tuned interpreters, and justin-time byte code compilers can bring performance close to that of native code without threatening portability.
Y9MC93007
The most common types of programs written in the Java programming language are applets and applications. If youve surfed the Web, youre probably already familiar with applets. An applet is a program that adheres to certain conventions that allow it to run within a Java-enabled browser. However, the Java programming language is not just for writing cute, entertaining applets for the Web. The general-purpose, high-level Java programming language is also a powerful software platform. Using the generous API, you can write many types of programs. An application is a standalone program that runs directly on the Java platform. A special kind of application known as a server serves and supports clients on a network. Examples of servers are Web servers, proxy servers, mail servers, and print servers. Another specialized program is a servlet. A servlet can almost be thought of as an applet that runs on the server side. Java Servlets are a popular choice for building interactive web applications, replacing the use of CGI scripts. Servlets are similar to applets in that they are runtime extensions of applications. Instead of working in browsers, though, servlets run within Java Web servers, configuring or tailoring the server. How does the API support all these kinds of programs? It does so with packages of software components that provides a wide range of functionality. Every full implementation of the Java platform gives you the following features:
The essentials: Objects, strings, threads, numbers, input and output, data Applets: The set of conventions used by applets. Networking: URLs, TCP (Transmission Control Protocol), UDP (User Internationalization: Help for writing programs that can be localized for
users worldwide. Programs can automatically adapt to specific locales and be displayed in the appropriate language.
Security: Both low level and high level, including electronic signatures,
Y9MC93007
range of relational databases. The Java platform also has APIs for 2D and 3D graphics, accessibility, servers, collaboration, telephony, speech, animation, and more. The following figure depicts what is included in the Java 2 SDK.
powerful object-oriented language, its easy to learn, especially for programmers already familiar with C or C++.
Y9MC93007
coding practices, and its garbage collection helps you avoid memory leaks. Its object orientation, its JavaBeans component architecture, and its wide-ranging, easily extendible API let you reuse other peoples tested code and introduce fewer bugs.
as twice as fast versus writing the same program in C++. Why? You write fewer lines of code and it is a simpler programming language than C++.
Avoid platform dependencies with 100% Pure Java: You can keep your
program portable by avoiding the use of libraries written in other languages. The 100% Pure JavaTM Product Certification Program has a repository of historical process manuals, white papers, brochures, and similar materials online.
Write once, run anywhere: Because 100% Pure Java programs are
compiled into machine-independent byte codes, they run consistently on any Java platform.
Distribute software more easily: You can upgrade applets easily from a
central server. Applets take advantage of the feature of allowing new classes to be loaded on the fly, without recompiling the entire program.
Finally we decided to proceed the implementation using Java Networking. And for dynamically updating the cache table we go for MS Access database. JAVA HA TWO THINGS: A PROGRAMMING LANGUAGE AND A PLATFORM. JAVA IS A HIGH-LEVEL PROGRAMMING LANGUAGE THAT IS ALL OF THE FOLLOWING
SIMPLE
ARCHITECTURE-NEUTRAL
Y9MC93007
DYNAMIC
JAVA
JAVA
BYTE CODES THE PLATFORM-INDEPENDENT CODE INSTRUCTION IS PASSED AND RUN ON THE
COMPUTER.
COMPILATION
EXECUTED.
Java Program
Interpreter
Compilers
My Program
Y9MC93007
YOU
CAN THINK OF
JAVA
BYTE CODES AS THE MACHINE CODE INSTRUCTIONS FOR THE INTERPRETER, WHETHER ITS A
JAVA
JAVA
DEVELOPMENT
WEB BROWSER THAT CAN RUN JAVA APPLETS, IS AN IMPLEMENTATION OF THE JAVA VM.
JAVA
YOUR
WRITE
YOU
CAN COMPILE
JAVA
JAVA
COMPILER.
THE
BYTE
CODES CAN THEN BE RUN ANY IMPLEMENTATION OF THE PROGRAM CAN RUN
SWINGS:
This introduction to using Swing in Java will walk you through the basics of Swing. This covers topics of how to create a window, add controls, postion the controls, and handle events from the controls. SIDDHARTH INSTITUTE OF PG STUDIES Page | 33
Y9MC93007
Y9MC93007
method in the frame class. Always try to separate the code that deals with visual presentation from the code that deals with application logic starting and initializing the application is part of application logic, not a part of visual presentation. A good practice is to create an Application class that will contain initialization code. package com.neuri.handsonswing.ch1; public class Application { public static void main(String[] args) { // perform any initialization MainFrame mf = new MainFrame(); mf.show(); } } If you run the code now, you will see an empty frame. When you close it, something not quite obvious will happen (or better said, will not happen). The application will not end. Remember that the Frame is just a visual part of application, not application logic if you do not request application termination when the window closes, your program will still run in the background (look for it in the process list). To avoid this problem, add the following line to the MainFrame constructor:
Y9MC93007
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Before Java2 1.3, you had to register a window listener and then act on the window closing event by stopping the application. Since Java2 1.3, you can specify a simple action that will happen when a window is closed with this shortcut. Other options are HIDE_ON_CLOSE (the default window is closed but application still runs) and DO_NOTHING_ON_CLOSE (rather strange option that ignores a click on the X button in the upper right corner).
Adding Components
Now is the time to add some components to the window. In Swing (and the Swing predecessor, AWT) all visual objects are subclasses of Component class. The Composite pattern was applied here to group visual objects into Containers, special components that can contain other components. Containers can specify the order, size and position of embedded components (and this can all be automatically calculated, which is one of the best features of Swing). JButton is a component class that represents a general purpose button it can have a text caption or an icon, and can be pressed to invoke an action. Lets add the button to the frame (note: add imports for javax.swing.* and java.awt.* to the MainFrame source code so that you can use all the components). When you work with JFrame, you want to put objects into its content pane special container intended to hold the window contents. Obtain the reference to that container with the getContentPane() method. Container content = getContentPane(); content.add(new JButton("Button 1"));
Y9MC93007
If you try to add more buttons to the frame, most likely only the last one added will be displayed. That is because the default behavior of JFrame content pane is to display a single component, resized to cover the entire area.
Grouping Components
To put more than one component into a place intended for a single component, group them into a container. JPanel is a general purpose container, that is perfect for grouping a set of components into a larger component. So, lets put the buttons into a JPanel: JPanel panel=new JPanel(); panel.add(new JButton("Button 1")); panel.add(new JButton("Button 2")); panel.add(new JButton("Button 3")); content.add(panel);
Y9MC93007
Y9MC93007
The best choice for the window content pane is usually a BorderLayout with a central content part and a bottom status (or button) part. The top part can contain a toolbar, optionally. Now, introduce lets a combine and new layouts, component several and
components
JTextArea. JTextArea is basically a multiline editor. Initialize the frame content pane explicitly to into BorderLayout, put a new JTextArea the central part and move the button panel below. package com.neuri.handsonswing.ch1; import java.awt.*; import javax.swing.*; public class MainFrame extends JFrame { public MainFrame() { super("My title"); setSize(300,300); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container content = getContentPane(); content.setLayout(new BorderLayout()); JPanel panel = new JPanel(new FlowLayout()); panel.add(new JButton("Button 1")); panel.add(new JButton("Button 2")); panel.add(new JButton("Button 3")); content.add(panel, BorderLayout.SOUTH); SIDDHARTH INSTITUTE OF PG STUDIES Page | 39
Y9MC93007
Notice that the layouts for content pane and the button panel are explicitly defined. Also notice the last two lines of code this is the other version of add method, which allows you to specify the way the component is added. In this case, we specify the area of BorderLayout layout manager. Central part is called BorderLayout.CENTER, and other areas are called BorderLayout.NORTH (top), BorderLayout.SOUTH (bottom), BorderLayout.WEST (left) and BorderLayout.EAST (right). If you get confused about this, just remember land-maps from your geography classes.
OPEN JAVA
DATABASE CONNECTIVITY (ODBC) IS USED TO ACCESS THE RELATIONAL DATABASES. IT OFFERS THE
ABILITY TO CONNECT TO ALMOST ALL THE DATABASES ON ALMOST ALL PLATFORMS.
ODBC
THEN
WE NEED
OF POINTERS.
JAVA
TO NATIVE
ODBC
IS HARD TO LEARN.
IT
Y9MC93007
ARCHITECTURE OF JDBC:
JDBC ARCHITECTURE CONTAINS THREE LAYERS:
JDBC Application
JDBC Drivers
JDBC Drivers
APPLICATION LAYER:
JAVA
TABLE. PROGRAM WANTS TO GET A CONNECTION TO A DATABASE.
IT
DATABASE TO DISPLAY ON THE SCREEN OR TO MODIFY THE EXISTING DATA OR TO INSERT THE DATA INTO THE
JDBC
ARCHITECTURE.
WHEN
IT RECEIVES A
SQL CALLS FROM THE APPLICATION AND CONVERTS THEM A JDBC DRIVER IS RESPONSIBLE FOR ENSURING THAT
Y9MC93007
ODBC JDBC
DRIVER, THE
ODBC
DRIVER COMMUNICATES WITH THE DATABASE AND SENDS THE REQUEST AND GETS
THE RESULTS.
THE RESULTS WILL BE PASSED TO THE JDBC DRIVER AND IN TURN TO THE APPLICATION. SO, THE ODBC AND GET THE RESULTS FROM THE ODBC.
DRIVER HAS NO KNOWLEDGE ABOUT THE ACTUAL DATABASE, IT KNOWS HOW TO PASS THE APPLICATION
REQUEST O THE
THE JDBC
AND THE
AND
ODBC
THE
JDBC API
ODBC ARE BUILT ON AN INTERFACE CALLED CALL LEVEL INTERFACE (CLI). BECAUSE OF THIS REASON JDBC DRIVER TRANSLATES THE REQUEST TO AN ODBC CALL. THE ODBC THEN CONVERTS THE REQUEST THE
RESULTS OF THE REQUEST ARE THEN FED BACK THROUGH THE
Y9MC93007
To find and retrieve just the data that meets conditions that you specify, including data from multiple tables, create a query. A query can also update or delete multiple records at the same time, and perform predefined or custom calculations on your data. To easily view, enter, and change data directly in a table, create a form. When you open a form, Microsoft Access retrieves the data from one or more tables, and displays it on the screen with the layout you choose in the Form Wizard, or a layout that you create from scratch. To analyze your data or present it a certain way in print, create a report. For example, you might print one report that groups data and calculates totals, and another report with different data formatted for printing mailing labels. To make data available on the Internet or an intranet for interactive reporting, data entry, or data analysis, use a data access page. Microsoft Access retrieves the data from one or more tables and displays it on the screen with the layout you choose in the Page Wizard, or a layout that you create from scratch. Users can interact with the data by using features on the data access page.
Y9MC93007
subdatasheets within the main datasheet. With some restrictions, you can work with the data in subdatasheets in many of the same ways that you work with data in the main datasheet.
Modules: What they are and how they work WHAT IS A MODULE?
A module is a collection of Visual Basic for Applications declarations and procedures that are stored together as a unit. There are two basic types of modules: class modules and standard modules. Each procedure in a module can be a Function procedure or a Sub procedure.
CLASS MODULES
Form and report modules are class modules that are associated with a particular form or report. Form and report modules often contain event procedures that run in response to an event on the form or report. You can use event procedures to control the behavior of your forms and reports, and their response to user actions, such as clicking the mouse on a command button.
SIDDHARTH INSTITUTE OF PG STUDIES Page | 44
Y9MC93007
When you create the first event procedure for a form or report, Microsoft Access automatically creates an associated form or report module. Procedures in your form and report modules can call procedures you have added to standard modules. In Access 95, class modules exist in association only with a form or report. In Access 97 or later, class modules can also exist independent of a form or report, and this type of class module is listed in Modules under Objects on the Database window. You can use a class module in Modules to create a definition for a custom object.
STANDARD MODULES
Standard modules contain general procedures that aren't associated with any other object and frequently used procedures that can be run from anywhere within your database. You can view the list of standard modules in your database by clicking Modules under Objects in the Database window. Form, report, and standard modules are also listed in the Object Browser.
Y9MC93007
example, employees can be associated with orders they're responsible for by creating a relationship between the Employees table and the Orders table using the EmployeeID fields.
A ONE-TO-MANY RELATIONSHIP
A one-to-many relationship is the most common type of relationship. In a one-to-many relationship, a record in Table A can have many matching records in Table B, but a record in Table B has only one matching record in Table A.
A MANY-TO-MANY RELATIONSHIP
In a many-to-many relationship, a record in Table A can have many matching records in Table B, and a record in Table B can have many matching records in Table A. This type of relationship is only possible by defining a third table (called a junction table) whose primary key consists of two fields the foreign keys from both Tables A and B. A many-to-many relationship is really two one-to-many relationships with a third table. For example, the Orders table and the Products table have a many-to-many relationship that's defined by creating two one-to-many relationships to the Order Details table.
A ONE-TO-ONE RELATIONSHIP
In a one-to-one relationship, each record in Table A can have only one matching record in Table B, and each record in Table B can have only one matching record in Table A. This type of relationship is not common, because most information related in this way would be in one table. You might use a one-to-one relationship to divide a table with many fields, to isolate part of a table for security reasons, or to store information that applies only to a subset of the main table. For example, you might want to create a table to track employees participating in a fundraising soccer game.
DEFINING RELATIONSHIPS
The kind of relationship that Microsoft Access creates depends on how the related fields are defined:
A one-to-many relationship is created if only one of the related fields is a primary key or
A one-to-one relationship is created if both of the related fields are primary keys or have
unique indexes.
whose primary key consists of two fields the foreign keys from the two other tables.
Y9MC93007
The purpose of the design phase is to plan a solution of the problem specified by the requirement document. This phase is the first step in moving from problem domain to the solution domain. The design of a system is perhaps the most critical factor affecting the quality of the software, and has a major impact on the later phases, particularly testing and maintenance. The output of this phase is SIDDHARTH INSTITUTE OF PG STUDIES Page | 48
Y9MC93007
the design document. This document is similar to a blue print or plan for the solution, and is used later during implementation, testing and maintenance. The design activity is often divided into two separate phase-system design and detailed design. System design, which is sometimes also called top-level design, aims to identify the modules that should be in the system, the specifications of these modules, and how they interact with each other to produce the desired results. At the end of system design all the major data structures, file formats, output formats, as well as the major modules in the system and their specifications are decided. During detailed design the internal logic of each of the modules specified in system design is decided. During this phase further details of the data structures and algorithmic design of each of the modules is specified. The logic of a module is usually specified in a high-level design description language, which is independent of the target language in which the software will eventually be implemented. In system design the focus is on identifying the modules, whereas during detailed design the focus is on designing the logic for each of the modules. In other words, in system design the attention is on what components are needed, while in detailed design how the components can be implemented in software is the issue.
During the design phase, often two separate documents are produced. One for the system design and one for the detailed design . Together, these documents completely specify the design of the system. That is they specify the different modules in the system and internal logic of each of the modules.
Y9MC93007
A design methodology is a systematic approach to creating a design by application of set of techniques and guidelines. Most methodologies focus on system design. The two basic principles used in any design methodology are problem partitioning and abstraction. A large system cannot be handled as a whole, and so for design it is partitioned into smaller systems. Abstraction is a concept related to problem partitioning. When partitioning is used during design, the design activity focuses on one part of the system at a time. Since the part being designed interacts with other parts of the system, a clear understanding of the interaction is essential for properly designing the part. For this, abstraction is used. An abstraction of a system or a part defines the overall behavior of the system at an abstract level without giving the internal details. While working with the part of a system, a designer needs to understand only the abstractions of the other parts with which the part being designed interacts. The use of abstraction allows the designer to practice the "divide and conquer" technique effectively by focusing one part at a time, without worrying about the details of other parts.Like every other phase, the design phase ends with verification of the design. If the design is not specified in some executable language, the verification has to be done by evaluating the design documents. One way of doing this is thorough reviews. Typically, at least two design reviews are held-one for the system design and one for the detailed and one for the detailed design.
Y9MC93007
and will be the basic during testing phase. Any changes made to the requirements in the future will have to go through formal change approval process. The trends of increasing technical complexity of the systems, coupled with the need for repeatable and predictable process methodologies, have driven System Developers to establish system development models or software development life cycle models. Nearly three decades ago the operations in an organization used to be limited and so it was possible to maintain them using manual procedures. But with the growing operations of organizations, the need to automate the various activities increased, since for manual procedures it was becoming very difficult, slow and complicated. Like maintaining records for a thousand plus employees company on papers is definitely a cumbersome job. So, at that time more and more companies started going for automation. Since there were a lot of organizations, which were opting for automation, it was felt that some standard and structural procedure or methodology be introduced in the industry so that the transition from manual to automated system became easy. The concept of system life cycle came into existence then. Life cycle model emphasized on the need to follow some structured approach towards building new or improved system. There were many models suggested. A waterfall model was among the very first models that came into existence. Later on many other models like prototype, rapid application development model, etc were also introduced. System development begins with the recognition of user needs. Then there is a preliminary investigation stage. It includes evaluation of present system, information gathering, feasibility study, and request approval. Feasibility study includes technical, economic, legal and operational feasibility. In economic SIDDHARTH INSTITUTE OF PG STUDIES Page | 51
Y9MC93007
feasibility cost-benefit analysis is done. After that, there are detailed design, implementation, testing and maintenance stages. In this session, we'll be learning about various stages that make system's life cycle. In addition, different life cycles models will be discussed. These include Waterfall model, Prototype model, Object-Oriented Model, spiral model and Dynamic Systems Development Method (DSDM).
Y9MC93007
detailed user interface mock-up document The implementation constraints are decided during the object-oriented design (OOD) process
Y9MC93007
The tool Objectory was created by the team at Objectory AB to implement the OOSE methodology. After success in the marketplace, other tool vendors also supported OOSE After Rational bought Objectory AB, the OOSE notation, methodology, and tools became superseded
As one of the primary sources of the Unified Modeling Language (UML), concepts and notation from OOSE have been incorporated into UML
The methodology part of OOSE has since evolved into the Rational Unified Process (RUP)
The OOSE tools have been replaced by tools supporting UML and RUP
OOSE has been largely replaced by the UML notation and by the RUP methodology
Use case diagrams Class diagrams Object diagrams Sequence diagrams Collaboration diagrams Statechart diagrams Activity diagrams Component diagrams Deployment diagrams
Some of the sections of this course contain links to pages with more detailed information. And every section has short questions. Use them to test your understanding of the section topic. SIDDHARTH INSTITUTE OF PG STUDIES Page | 54
Y9MC93007
. Group Business Term Accounting Periods Definition A defined period of time whereby performance reports may be extracted. (normally 4 week periods).
Y9MC93007
Technical Association
Technical
Class
A logical entity encapsulating data and behavior. A class is a template for an object - the class is the design, the object the runtime instance. The component model provides a detailed view of the various hardware and software components that make up the proposed system. It shows both where these components reside and how they inter-relate with other components. Component requirements detail what responsibilities a component has to supply functionality or behavior within the system. A person or a company that requests An entity to transport goods on their behalf.
Technical
Component Model
Business
Customer
Technical
Deployment Architecture A view of the proposed hardware that will make up the new system, together with the physical components that will execute on that hardware. Includes specifications for machine, operating system, network links, backup units &etc. Deployment Model Extends Relationship A model of the system as it will be physically deployed A relationship between two use cases in which one use case 'extends' the behavior of another. Typically this represents optional behavior in a use case scenario - for example a user may optionally request a list or report
Technical Technical
Y9MC93007
Technical
Includes Relationship
A relationship between two use cases in which one use case 'includes' the behavior. This is indicated where there a specific business use cases which are used from many other places - for example updating a train record may be part of many larger business processes. A Use Case represents a discrete unit of interaction between a user (human or machine) and the system. A Use Case is a single unit of meaningful work; for example creating a train, modifying a train and creating orders are all Use Cases.Each Use Case has a description which describes the functionality that will be built in the proposed system. A Use Case may 'include' another Use Case's functionality or 'extend' another Use Case with its own behavior.Use Cases are typically related to 'actors'. An actor is a human or machine entity that interacts with the system to perform meaningful work.
Technical
Use Case
1.1
ACTORS
Actors are the users of the system being modeled. Each Actor will have a well-defined role, and in the context of that role have useful interactions with the system.
A person may perform the role of more than one Actor, although they will only assume one role during one use case interaction.
Y9MC93007
An Actor role may be performed by a non-human system, such as another computer program.
EA 7.1 Unregistered Trial Version EA 7.1 Unregistered Trial Version EA 7.1 Unregistered Trial Version uc Actors EA 7.1 Unregistered Trial Version EA 7.1 Unregistered Trial Version EA 7.1 Unregistered Trial Version
Figure 2: Actors
SecuritySpecialist
EA 7.1 Unregistered Trial Version EA 7.1 Unregistered Trial Version EA 7.1 Unregistered Trial Version EA 7.1 Unregistered Trial Version Unregistered Trial Version
Use-Cases: 7.1 EA
Developers. EA Machine user can; begin using the system this represents whichever method The 7.1 Unregistered Trial Version the user will use in order to make initial interaction with the system. For example, they may need
We have identified 2 actors in these diagrams, the actual Machine Users and the Unix
EA on via a button, simply turn the key Version to turn the system7.1 Unregistered Trial in the ignition or some over method. They
can also view a page, click on a link or back button, scroll up and down and close the system.
EA 7.1 Unregistered cases, Version The Microsoft Developer inherits all these useTrialas well as being able to upload an html file
and view a list of problems.
SIDDHARTH INSTITUTE OF PG STUDIES Page | 58
Y9MC93007
Nd 2 oe
Sn ed
Pr n atitio
Mr e eg
R c iv ee e
Nd 2 oe
Class Diagram:
Y9MC93007
class System
JFrame TimeGraph ~ ~ ~ ~ ~ + + + + + con: Connection = null r: Random = new Random(12) rs: ResultSet = null stmt: Statement = null timeList: ArrayList = new ArrayList() totalValue: double = 0 createCombinedChart(ArrayList) : JFreeChart createDataset(ArrayList) : XYDataset main(String[]) : void TimeGraph(String) ~t_graph ~demo1
JFrame ActionListener Login ~ ~ ~ ~ ~ ~ ~ + + + c: Connect filepath: String j_panel: JPanel jb_Exit: JButton jb_Sign_up: JButton jl_title: JLabel msg: String actionPerformed(ActionEvent) : void Logi n() main(String[]) : voi d ~l
~ts Thread ClientSocket ~ ~ ~ ~ ~ ~ + cli Frm: ClientFrame formListMap: HashMap = new HashMap() port: int = 100 tcpClientSocket: ServerSocket = null tcpSocket: Socket = null tss: ClientStart userList: ArrayList = new ArrayList() ~clientSocket JFrame ClientFrame + + + ~cliFrm ClientSocket(ClientFrame) mai n(String[]) : void run() : void
~c Connect ~ ~ ~ ~ ~ ~ ~ ~ ~ ~connect ~ ~ ~ ~ ~ ~ JPanel ~ ActionListener ~ Observer + + + + br: BufferedReader = null cli entSocket: ClientSocket f: File fr: FileReader frame: Cl ientFrame ip: String IpAddresss: String l: Login mgs1: String ([]) = new String[100] msg: String obj Reader: ObjectInputStream obj Writer: ObjectOutputStream port: int pw: PrintWriter = nul l s: Socket user: Users userName: String Connect(Login) Connect() connectProxyServer(String, Stri ng, String) : void logoutServer(String) : void
JDial og UploadForm ~ ~ ~ ~ ~ ~ ~ ~ ~ + + + + + buf: byte ([]) button1: JButton button2: JButton button3: JButton cf: ClientFrame chartMSG: String = "" fd: Fil eDialog fin: Fi leInputStream label1: JLabel luser: Users objReader: Obj ectInputStream objWriter: Obj ectOutputStream panel1: JPanel suser: Users textField1: JTextField button1ActionPerformed(Acti onEvent) : void button2ActionPerformed(Acti onEvent) : void button3ActionPerformed(Acti onEvent) : void initComponents() : void main(String[]) : void sendFile() : void Upl oadForm(Frame, Users, Cl ientFrame) Upl oadForm(Frame) Upl oadForm(Dialog)
~uploadForm
~ ~ ~ ~ ~ ~ ~cf ~ ~ ~ + + + + + +
button1: JButton chart: JFreeChart clientLi st: Vector = new Vector() connect: Connect filename: String t_graph: TimeGraph temp: int = 0 timeList: ArrayList = new ArrayList() uploadForm: UploadForm username: String ClientFrame() ClientFrame(Connect, String) downl oadFile() : void downl oadRecov() : voi d initComponents() : void list1MouseClicked(MouseEvent) : void list2MouseClicked(MouseEvent) : void loadData(Users) : void saveFile(Users) : void
~frame
FileSplitter ~fileSplitter + + + + deleteCheckBox: JCheckBox fileIcon: ImageIcon frame: JFrame MERGE: String = "MERGE" {readOnly} progressBar: JProgressBar selectedFile: Fil e = null SPLIT: String = "SPLIT" {readOnl y} splitSourceFil eField: JTextField unitsCombo: JComboBox actionPerformed(ActionEvent) : void addMergePanel() : void addSplitPanel () : void addStatusPanel() : void centralizeFrame() : void createMergePanelComponents() : void createSplitPanelComponents() : void Fil eSplitter() getSplitSi ze(String, String) : long main(Stri ng[]) : void mergeFile() : void notValidMergeFields() : bool ean setLookAndFeel(JFrame, String) : void showDirChooser(JTextField) : void splitFile() : void update(Observable, Object) : void
Y9MC93007
class Class Model Serializable ClientFile + + + + + + + + + + + + + access_flag: String buffer: byte ([]) filecode: String fileName: String msg: String username: String ClientFile() getAccess_flag() : String getBuffer() : byte[] getFilecode() : String getFileName() : String getMsg() : String getUsername() : String setAccess_flag(String) : void setBuffer(byte[]) : void setFilecode(String) : void setFileName(String) : void setMsg(String) : void setUsername(String) : void
JFrame Runnable AdminServ erFrame ~ ~ + ~ ~ ~ ~ + + + + + + + numberOfUsers: int = 0 panel1: JPanel scrollPane1: JScrollPane server: Server textArea1: JT extArea timeList: ArrayList = new ArrayList() user: Users userEditForm: UserEditForm userSaveForm: UserSaveForm addOnLineUsers() : void AdminServerFrame() checkRemoteUser() : void ini tComponents() : void main(String[]) : void run() : void updateMainUserList() : void updateUserList() : void
Thread Serv er ~ ~ ~server ~ ~ + + + + + asf: AdminServerFrame tcpServerSocket: ServerSocket = null tcpSocket: Socket = null tss: ServerStart userList: ArrayList = new ArrayList() main(String[]) : void run() : void Server() Server(AdminServerFrame) ~ts
~asf
DataBase + + ~ + ~ + + + + con: Connection = null stmt: Statement = null totalRecord: int createNewUser(Users) : String DataBase() deleteFi le(String) : String deleteUser(Users) : String getFilesForUser(String) : ArrayList validateuploadRights(Users) : String
~user java.io.Serializable Users + + + + + + + + + + active: String = "Y" buffer: byte ([]) download_flag: String = "Y" fileList: ArrayList fileName: String ipAddress: String loginTime: String passWord: String port: int getDownload_flag() : String getFileList() : ArrayList getLoginTime() : String getParm() : String getPassWord() : String getPort() : int getUserName() : String setActive(String) : void setBuffer(byte[]) : void Serv erStart ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ + + + ~ + + age: String = "" fil eName: String = "" msg: String = "" objReader: ObjectInputStream objWriter: ObjectOutputStream password: String = "" sex: String = "" timeGraphVO: T imeGraphVO user: Users username: String = "" downLoadFile(Users) : Users main(String[]) : void run() : void ServerStart() updateUserList() : void userLoginCeck(String) : boolean ~tss Thread
~user
We have identified 5 classes in total. A Lexer class and a Parser class - which comprise the Analyser package a ParsedTreeStructure class, a Renderer class and a Frontend class. The Lexers job is to build a set of tokens from a source file. The Parser uses these tokens built and
SIDDHARTH INSTITUTE OF PG STUDIES Page | 61
Y9MC93007
deciphers their types. It then builds the tokens seen into nodes and parses them to the ParsedTreeStructure class, where a tree structure of nodes is stored. This tree is then used by the Renderer class to form a model of the page, which is in turn, is used by the Frontend in order to display the final rendered page.
Activity Diagrams:
These activity diagrams show how the use-cases interact with the system and interface. The User starts by initially interacting with the system. The main page is then rendered by the system and it is displayed by the interface, which the user can view. From here the user can click on a link, scroll or close the system. If they chose to click a link, the system renders the new page and it is displayed by the interface, which brings the user back to viewing. If the user chooses to scroll, the system will readjust the page and the interface will display the new snapshot of the page, which also brings the user back to viewing. If the user chooses to close the system, the activity diagram finishes in an exit state. The Unix Developer can do all of the above as it inherits all of the Machine Users use-cases. On top of this they can upload an html file, which will then begin to be rendered by the system. If problems are found with the code, the interface will display a list of problems which the developer can view. Otherwise, if no problems are found, the page will be fully rendered by the system, and then displayed by the interface, which the developer can view. Once developer can view the page or problems, they can then decide to load a new html file. If they do decide to, they go back to Upload New File, if not, the activity reaches an exit state.
Y9MC93007
Send
Splt
M erge
R eceiv e
Sequence Diagram:
A sequence diagram shows, as parallel vertical lines ( lifelines), different processes or objects that live simultaneously, and, as horizontal arrows, the messages exchanged between them, in the order in which they occur. This allows the specification of simple runtime scenarios in a graphical manner. For instance, the UML 1.x diagram on the right describes the sequences of messages of a (simple) restaurant system. This diagram represents a Patron ordering food and wine, drinking wine then eating the food, and finally paying for the food. The dotted lines extending downwards indicate the timeline. Time flows from top to bottom. The arrows represent messages (stimuli) from an actor or object to other objects. For example, the Patron sends message 'pay' to the Cashier. Half arrows indicate asynchronous method calls. The UML 2.0 Sequence Diagram supports similar notation to the UML 1.x Sequence Diagram with added support for modeling variations to the standard flow of events.
Y9MC93007
Node1
Send/Receive
Split / Merge
Node2
Collaboration Diagram:
This diagram shows the collaboration between the 5 classes and demonstrates the order of events that will take place when a page is loaded. The Lexer will build tokens based on the text it has been given, the Parser then deciphers types of tokens that are generated by the Lexer class. These are then parsed to the Tree Structure in the form of nodes, which are then assembled into a tree structure. Next the Renderer class uses these nodes to build the page and finally the Frontend class takes what the Renderer has created and displays it for the user.
4: displayPage()
:Frontend
4: Receiving rhe file 3: Merging rhe file 5: the file has been received 2: Splitting the file
Split/Merge
Node2
Y9MC93007
State Diagram:
State diagrams are used to give an abstract description of the behavior of a system. This behavior is analyzed and represented in series of events, that could occur in one or more possible states. Hereby "each diagram usually represents objects of a single class and track the different states of its objects through the system. State diagrams can be used to graphically represent finite state machines. This was introduced by Taylor Booth in his 1967 book "Sequential Machines and Automata Theory". Another possible representation is the State transition table.
Node1
Split/Merge
Receive
Node2
Component Diagram:
Components are wired together by using an assembly connector to connect the required interface of one component with the provided interface of another component. This illustrates the service consumer service provider relationship between the two components.
Y9MC93007
An assembly connector is a "connector between two components that defines that one component provides the services that another component requires. An assembly connector is a connector that is defined from a required interface or port to a provided interface or port.
Send Node 1
Split/Merge Receive
Node 2
DEPLOYMENT DIAGRAM:
Deployment Diagram shows the configuration of run time processing nodes and the components that live on them. It is used for modeling topology of the hardware on which your system executes.
A deployment diagram in the Unified Modeling Language models the physical deployment of artifacts on nodes.[1] To describe a web site, for example, a deployment diagram would show what hardware components ("nodes") exist (e.g. a web server, an application server, and a database server), what software components ("artifacts") run on each node (e.g. web application, database), and how the different pieces are connected
Y9MC93007
Nd 1 oe
S n /R ed e iv ce e
Nd 2 oe
S lit/M p e rg e
c lass Sche ma1 USER_TB col u m n USERNAM E: VARCHAR2(20 BYT E) USERPASSWORD: VARCHAR2(2 0 BYT E) USERCODE: NUM BER(5 ) ACT IVE: VARCHAR2(20 BYT E) UPLO AD_FL AG: VARCHAR2(2 0 BYT E) DO WNLO AD_ FLAG : VARCHAR2(20 BYT E)
FILES_ TB col um n FIL ECODE: NUM BER(5) FIELNAM E: VARCHAR2(30 BYT E) ULD_USER_CO DE: NUM BER(10)
ACCESS_TB colum n FILECO DE: NUM BER(10) USERCO DE: NUM BER(10) ACCESS_FL AG: NUM BER(1 0)
Y9MC93007
ACCESS_TB
Database:
Detail: Notes:
Oracle, Stereotype: table, Package: Schema1 Created on 4/1/2011. Last modified on 4/1/2011.
Columns
PK
Name
Notes
Relationships
Columns
Notes
FILES_TB
Database:
Detail: Notes:
Oracle, Stereotype: table, Package: Schema1 Created on 4/1/2011. Last modified on 4/1/2011.
Columns
PK
Name
Type NUMB ER
Notes
VARCH False
Y9MC93007
False
False
10
Relationships
Columns
Notes
USER_TB
Database:
Detail: Notes:
Oracle, Stereotype: table, Package: Schema1 Created on 4/1/2011. Last modified on 4/1/2011.
Columns
PK
Name
Type
Not Null
Unique Len Pre Scale Init c False False False False False False 20 20 0 20 20 20 0 0 5 0 0 0 0 0 0 0 0 0
Notes
Fals UPLOAD_FLAG VARCH False e AR2 Fals DOWNLOAD_F e LAG VARCH False AR2
Relationships
Columns
Association USER_TB.
Notes
Y9MC93007
Columns
Development Phase
Once the design is complete, most of the major decisions about the system have been made. The goal of the coding phase is to translate the design of the system into code in a given programming language. For a given design, the aim of this phase is to implement the design in the best possible manner. The coding phase affects both testing and maintenance profoundly. A well written code reduces the testing and maintenance effort. Since the testing and maintenance cost of software are much higher than the coding cost, the goal of coding should be to reduce the testing and maintenance effort. Hence, during coding the focus should be on developing programs that are easy to write. Simplicity and clarity should be strived for, during the coding phase. An important concept that helps the understandability of programs is structured programming. The goal of structured programming is to arrange the control flow in the program. That is, program text should be organized as a sequence of statements, and during execution, the statements are executed in the sequence in the program. For structured programming, a few single-entry-single-exit constructs should be used. These constructs includes selection (if-then-else), and iteration (while - do, repeat - until etc). With these constructs it is possible to construct a program as sequence of single - entry - single - exit constructs. There are many methods available for verifying the code. Some methods are static in nature that is, that is they do not involve execution of the code. Examples of such methods are data flow SIDDHARTH INSTITUTE OF PG STUDIES Page | 70
Y9MC93007
analysis, code reading, code reviews, testing (a method that involves executing the code, which is used very heavily). In the coding phase, the entire system is not tested together. Rather, the different modules are tested separately. This testing of modules is called "unit testing". Consequently, this phase is often referred to as "coding and unit testing". The output of this phase is the verified and unit tested code of the different modules.
Y9MC93007
System Testing
Testing is the major quality control measure employed during software development. Its basic function is to detect errors in the software. During requirement analysis and design, the output is a document that is usually textual and non-executable. After the coding phase, computer programs are available that can be executed for testing phases. This implies that testing not only has to uncover errors introduced during coding, but also errors introduced during the SIDDHARTH INSTITUTE OF PG STUDIES Page | 72
Y9MC93007
previous phases. Thus, the goal of testing is to uncover requirement, design or coding errors in the programs.
Consequently, different levels of testing are employed. The starting point of testing is unit testing. In this a module is tested separately and is often performed by the coder himself simultaneously with the coding of the module. The purpose is to execute the different parts of the module code to detect coding errors. After this the modules are gradually integrated into subsystem, which are then integrated themselves eventually form the entire system. During integration of modules, integration testing is performed. The goal of this testing is to detect design errors, while focusing on testing the interconnection between modules. After the system is put together, system testing is performed. Here the system is tested against tech system requirements to see if all the requirements are met and the system performs as specified by the requirements. Finally, acceptance testing is performed to demonstrate to the client, on the real life data of the client, the separation of the system. For testing to be successful, proper selection of test cases is essential. There are two different approaches to selecting test cases-functional testing and structural testing. In functional testing the software for the module to be tested is treated as black box, and then test cases are decided based on the specifications of the system or module. For this reason, this form of testing is also called "black box testing". The focus is on testing the external behavior of the system. In structural testing the test cases are decided based on the logic of the module to be tested. Structural testing is sometimes called "glass box testing". Structural testing is used for lower levels of testing and functional testing is used for higher levels. Testing is an extremely critical and time-consuming activity. It requires proper planning of the overall testing process. Frequently the testing process starts with the test plan. This plan identifies all the testing related activities that must be performed and specifies the schedule, allocates the resources, and specify guidelines for testing. The test plan specifies manner in which the modules will integrate together. Then for different test units, a test case specification document is produced, which lists all the different test cases, together with the expected outputs, that will be used for testing. During the testing of the unit, the specified test cases are executed and actual result is compared with the expected output. The final output of the testing phases is to the text report and the error report, or set of such reports (one of each unit is tested). Each test report contains the set of such test cases and the result of executing the code with these test cases The error report describes the errors encountered and action taken to remove those errors.
Y9MC93007
Testing is basically a process to detect errors in the software product. Before going into the details of testing techniques one should know what errors are. In day-today life we say whenever something goes wrong there is an error. This definition is quite vast. When we apply this concept to software products then we say whenever there is difference between what is expected out of software and what is being achieved, there is an error. For the output of the system, if it differs from what was required, it is due to an error. This output can be some numeric or alphabetic value, some formatted report, or some specific behavior from the system. In case of an error there may be change in the format of out, some unexpected behavior from system, or some value different from the expected is obtained. These errors can due to wrong analysis, wrong design, or some fault on developer's part. All these errors need to be discovered before the system is implemented at the customer's site. Because having a system that does not perform as desired be of no use. All the effort put in to build it goes waste. So testing is done. And it is equally important and crucial as any other stage of system development. For different types of errors there are different types of testing techniques. In the section that follows we'll try to understand those techniques.
OBJECTIVES OF TESTING
First of all the objective of the testing should be clear. We can define testing as a process of executing a program with the aim of finding errors. To perform testing, test cases are designed. A test case is a particular made up artificial situation upon which a program is exposed so as to find errors. So a good test case is one that finds undiscovered errors. If testing is done properly, it uncovers errors and after fixing those errors we have software that is being developed according to specifications.
Y9MC93007
Software configuration is required so that the testers know what is to be expected and tested whereas test configuration is testing plan that is, the way how the testing will be conducted on the system. It specifies the test cases and their expected value. It also specifies if any tools for testing are to be used. Test cases are required to know what specific situations need to be tested. When tests are evaluated, test results are compared with actual results and if there is some error, then debugging is done to correct the error. Testing is a way to know about quality and reliability. Error rate that is the occurrence of errors is evaluated. This data can be used to predict the occurrence of errors in future.
TEST CASE
DESIGN
We now know, test cases are integral part of testing. So we need to know more about test cases and how these test cases are designed. The most desired or obvious expectation from a test case is that it should be able to find most errors with the least amount of time and effort. A software product can be tested in two ways. In the first approach only the overall functioning of the product is tested. Inputs are given and outputs are checked. This approach is called black box testing. It does not care about the internal functioning of the product. The other approach is called white box testing. Here the internal functioning of the product is tested. Each procedure is tested for its accuracy. It is more intensive than black box testing. But for the overall product both these techniques are crucial. There should be sufficient number of tests in both categories to test the overall product. SIDDHARTH INSTITUTE OF PG STUDIES Page | 75
Y9MC93007
For performing white box testing, basic path testing technique is used. We will illustrate how to use this technique, in the following section.
Sequence -
Until -
Y9MC93007
If -
While -
Case -
BASIC
Node: Each flow graph node represents one or more procedural statements. Each
represent flow of control. An edge must terminate at a node, even if the node does not represent any useful procedural statements.
Region: A region in a flow graph is an area bounded by edges and nodes.
Cyclomatic complexity: Independent path is an execution flow from the start point to the end point. Since a procedure contains control statements, there are various execution paths depending upon decision taken on the control statement. So Cyclomatic complexity provides the number of such execution independent paths. Thus it provides a upper bound for number of tests that must be produced because for each independent path, a test should be conducted to see if it is actually reaching the end point of the procedure or not.
Y9MC93007
EQUIVALENCE PARTITIONING
In equivalence partitioning, a test case is designed so as to uncover a group or class of error. This limits the number of test cases that might need to be developed otherwise. Here input domain is divided into classes or group of data. These classes are known as equivalence classes and the process of making equivalence classes is called equivalence partitioning. Equivalence classes represent a set of valid or invalid states for input condition. An input condition can be a range, a specific value, a set of values, or a boolean value. Then depending upon type of input equivalence classes is defined. For defining equivalence classes the following guidelines should be used. 1. If an input condition specifies a range, one valid and two invalid equivalence classes are defined. 2. If an input condition requires a specific value, then one valid and two invalid equivalence classes are defined. 3. If an input condition specifies a member of a set, then one valid and one invalid equivalence class are defined. 4. If an input condition is Boolean, then one valid and one invalid equivalence class are defined. For example, the range is say, 0 < count < Max1000. Then form a valid equivalence class with that range of values and two invalid equivalence classes, one SIDDHARTH INSTITUTE OF PG STUDIES Page | 78
Y9MC93007
with values less than the lower bound of range (i.e., count < 0) and other with values higher than the higher bound( count > 1000).
Y9MC93007
thoroughly. Performing testing without some testing strategy would be very cumbersome and difficult. Testing strategies are discussed the following pages of this chapter.
Y9MC93007
according to the specification given to them while coding. In cases where programs are big enough or collective effort is involved for coding, responsibilities for testing lies with the team as a whole. Debugging and testing are altogether different processes. Testing aims to finds the errors whereas debugging is the process of fixing those errors. But debugging should be incorporated in testing strategies. A software strategy must have low-level tests to test the source code and high-level tests that validate system functions against customer requirements.
Unit Testing
We know that smallest unit of software design is a module. Unit testing is performed to check the functionality of these units. it is done before these modules are integrated together to build the overall system. Since the modules are small in size, individual programmers can do unit testing on their respective modules. So unit testing is basically white box oriented. Procedural design descriptions are used and control paths are tested to uncover errors within individual modules. Unit testing can be done for more than one module at a time. The following are the tests that are performed during the unit testing:
Module interface test: here it is checked if the information is properly flowing into the program unit and properly coming out of it. Local data structures: these are tested to see if the local data within unit(module) is stored properly by them. Boundary conditions: It is observed that much software often fails at boundary conditions. That's why boundary conditions are tested to ensure that the program is properly working at its boundary conditions. Independent paths: All independent paths are tested to see that they are properly executing their task and terminating at the end of the program. Error handling paths: These are tested to check if errors are handled properly by them.
Y9MC93007
Fig 9.5 Unit Test Procedure Unit testing begins after the source code is developed, reviewed and verified for the correct syntax. Here design documents help in making test cases. Though each module performs a specific task yet it is not a standalone program. It may need data from some other module or it may need to send some data or control information to some other module. Since in unit testing each module is tested individually, so the need to obtain data from other module or passing data to other module is achieved by the use of stubs and drivers. Stubs and drivers are used to simulate those modules. A driver is basically a program that accepts test case data and passes that data to the module that is being tested. It also prints the relevant results. Similarly stubs are also programs that are used to replace modules that are subordinate to the module to be tested. It does minimal data manipulation, prints verification of entry, and returns. Fig. 9.5 illustrates this unit test procedure. Drivers and stubs are overhead because they are developed but are not a part of the product. This overhead can be reduced if these are kept very simple. Once the individual modules are tested then these modules are integrated to form the bigger program structures. So next stage of testing deals with the errors that occur while integrating modules. That's why next testing done is called integration testing, which is discussed next. SIDDHARTH INSTITUTE OF PG STUDIES Page | 82
Y9MC93007
Integration Testing
Unit testing ensures that all modules have been tested and each of them works properly individually. Unit testing does not guarantee if these modules will work fine if these are integrated together as a whole system. It is observed that many errors crop up when the modules are joined together. Integration testing uncovers errors that arises when modules are integrated to build the overall system. Following types of errors may arise:
Data can be lost across an interface. That is data coming out of a module is not going into the desired module. Sub-functions, when combined, may not produce the desired major function. Individually acceptable imprecision may be magnified to unacceptable levels. For example, in a module there is error-precision taken as +- 10 units. In other module same error-precision is used. Now these modules are combined. Suppose the errorprecision from both modules needs to be multiplied then the error precision would be +-100 which would not be acceptable to the system. Global data structures can present problems: For example, in a system there is a global memory. Now these modules are combined. All are accessing the same global memory. Because so many functions are accessing that memory, low memory problem can arise.
There are two approaches in integration testing. One is top down integration and the other is bottom up integration. Now we'll discuss these approaches.
Y9MC93007
Fig. 9.6 Top down integration In depth first approach all modules on a control path are integrated first. See fig. 9.6. Here sequence of integration would be (M1, M2, M3), M4, M5, M6, M7, and M8. In breadth first all modules directly subordinate at each level are integrated together. Using breadth first for fig. 9.6 the sequence of integration would be (M1, M2, M8), (M3, M6), M4, M7, andM5. Another approach for integration is bottom up integration, which we discuss in the following page.
Y9MC93007
4. Drivers are removed and clusters are combined moving upward in the program structure.
Fig. 9.7 (a) Program Modules (b)Bottom-up integration applied to program modules in (a) Fig 9.7 shows the how the bottom up integration is done. Whenever a new module is added to as a part of integration testing, the program structure changes. There SIDDHARTH INSTITUTE OF PG STUDIES Page | 85
Y9MC93007
may be new data flow paths, some new I/O or some new control logic. These changes may cause problems with functions in the tested modules, which were working fine previously.
To detect these errors regression testing is done. Regression testing is the reexecution of some subset of tests that have already been conducted to ensure that changes have not propagated unintended side effects in the programs. Regression testing is the activity that helps to ensure that changes (due to testing or for other reason) do not introduce undesirable behavior or additional errors. As integration testing proceeds, the number of regression tests can grow quite large. Therefore, regression test suite should be designed to include only those tests that address one or more classes of errors in each of the major program functions. It is impractical and inefficient to re-execute every test for every program functions once a change has occurred.
Validation Testing
After the integration testing we have an assembled package that is free from modules and interfacing errors. At this stage a final series of software tests, validation testing begin. Validation succeeds when software functions in a manner that can be expected by the customer. Major question here is what are expectations of customers. Expectations are defined in the software requirement specification identified during the analysis of the system.
The specification contains a section titled Validation Criteria Information contained in that section forms the basis for a validation testing. Software validation is achieved through a series of black-box tests that demonstrate conformity with requirements. There is a test plan that describes the classes of tests to be conducted, and a test procedure defines specific test cases that will be used in an attempt to uncover errors in the conformity with requirements. After each validation test case has been conducted, one of two possible conditions exists: The function or performance characteristics conform to specification and are accepted, or A deviation from specification is uncovered and a deficiency list is created. Deviation or error discovered at this stage in a project can rarely be corrected prior to scheduled completion. It is often necessary to negotiate with the customer to establish a method for resolving deficiencies. ALPHA AND BETA TESTING
SIDDHARTH INSTITUTE OF PG STUDIES Page | 86
Y9MC93007
For a software developer, it is difficult to foresee how the customer will really use a program. Instructions for use may be misinterpreted; strange combination of data may be regularly used; and the output that seemed clear to the tester may be unintelligible to a user in the field. When custom software is built for one customer, a series of acceptance tests are conducted to enable the customer to validate all requirements. Acceptance test is conducted by customer rather than by developer. It can range from an informal test drive to a planned and systematically executed series of tests. In fact, acceptance testing can be conducted over a period of weeks or months, thereby uncovering cumulative errors that might degrade the system over time. If software is developed as a product to be used by many customers, it is impractical to perform formal acceptance tests with each one. Most software product builders use a process called alpha and beta testing to uncover errors that only the end user seems able to find. Customer conducts the alpha testing at the developers site. The software is used in a natural setting with the developer. The developer records errors and usage problem. Alpha tests are conducted in a controlled environment. The beta test is conducted at one or more customer sites by the end user(s) of the software. Here, developer is not present. Therefore, the beta test is a live application of the software in an environment that cannot be controlled by the developer. The customer records all problems that are encountered during beta testing and reports these to the developer at regular intervals. Because of problems reported during beta test, the software developer makes modifications and then prepares for release of the software product to the entire customer base.
Y9MC93007
Y9MC93007
Function Requirements
Functional requirements specify which outputs should be produced from the given inputs. They describe the relationship between the input and output of the system, for each functional requirement a detailed description of all data inputs and their source and the range of valid inputs must be specified.
All the operations to be performed on the input data to obtain the output should be specified.
Y9MC93007
Y9MC93007
Y9MC93007
Server:
Y9MC93007
Client Page:
Y9MC93007
Partition Value:
Y9MC93007
Send File:
Y9MC93007
Partition Files:
Partition Metafile:
SIDDHARTH INSTITUTE OF PG STUDIES Page | 96
Y9MC93007
Y9MC93007
Y9MC93007
Y9MC93007
[1] S. Acharya, V. Poosala, and S. Ramaswamy, Selectivity Estimation in Spatial Databases, Proc. 1999 ACM SIGMOD, 1999. [2] A. Andrzejak and Z. Xu, Scalable, Efficient Range Queries for
SIDDHARTH INSTITUTE OF PG STUDIES Page | 100
Y9MC93007
Grid Information Services, Proc. Second Intl Conf. Peer-to-Peer Computing, 2002.
[3] B. Arai, G. Das, D. Gunopulos, and V. Kalogeraki, Approximating Aggregation Queries in Peer-to-Peer Networks, Proc. 22nd Intl Conf. Data Eng., 2006. [4] M. Bawa, H. Garcia-Molina, A. Gionis, and R. Motwani, Estimating Aggregates on a Peer-to-Peer Network, technical report, Stanford InfoLab, 2003. [5] N. Bruno, S. Chaudhuri, and L. Gravano, STHoles: A Multidimensional Workload-Aware Histogram, Proc. 2001 ACM SIGMOD, 2001. [6] S. Chaudhuri and U. Dayal, An Overview of Data Warehousing and OLAP Technology, Sigmod Record, vol. 26, no. 1, pp. 65-74, Mar. 1997. [7] E. Cohen and S. Shenker, Replication Strategies in Unstructured Peer-to-Peer Networks, Proc. ACM SIGCOMM 02, 2002. [ 8] A. Crainiceanu, P. Linga, J. Gehrke, and J. Shanmugasundaram, Querying Peer-to-Peer Networks Using P-Trees, Proc. Seventh Intl Workshop Web and Databases, 2004.