Build good software

Requirements and Design

Requirement Specification

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

Is a complete program to work out the jobs of package which provides complete procedure to construct good package. In this we designed a hierarchy for each functional demand decomposed into pieces of hierarchical measure wise statements with more item. Example, for pharmaceutics charge when the system is started, it should authenticate user before supplying its functionalities

  • The end product measure should look as incorporating the store name, reference, phone figure and drug licence no.
  • It contains which system clip, day of the month, reception, measure, merchandise name monetary value per individual and entire monetary value measure, and the terminal expansive sum for all merchandises, if VAT is applicable so vat drumhead.

Once the functionalities of Pharmacy system are classified so we grouped the related functionalities as a faculty, in this wholly we got 3 faculties, like

  1. Stock Maintenance
  2. Ordering
  3. Charge
  4. Reports

After this we designed package architecture to develop this system, because based on agenda, cost, and quality the package architecture returns highest returns on investings.

In our undertaking I ‘m traveling to utilize Java Swing API to develop GUI based user interfacing to interact with the system. Back terminal database is Oracle 10G. In the back terminal database we are traveling to keep charge information, Order Details and client information, Stock inside informations information and payment inside informations ( cash/ cheque..Etc ) .

To interact with the back terminal information base system, from GUI interface we need JDBC API to execute database relevant question operations towards the implicit in database.

In this package design we considered many facets harmonizing to our undertaking. Compatibility of backend and platforms, planing package etc, Extensibility we guarantee the system design even to add new sweetenings in future like to do as web based system. The cryptography is to be developed in such as manner that it can be used with either GUI application or web based application. It does intend that coding portion remain same no affair what user interface we use.

I design the system with needed security. Merely authenticated users can entree the system. I ‘m traveling to hold different functions in this system. Admin function and Employee function.

Approach And Methodology

Accordding to Shari Lawrence Pfleeger, Joanne M. Atlee, Software Engineering Theory and Practice, Fourth edition, The theoretical account that is fundamentally being followed is the WATER FALL MODEL, which states that the stages are organized in a additive order. First of all the feasibleness survey is done. Once that portion is over the demand analysis and undertaking planning begins. If system exists one and alteration and add-on of new faculty is needed, analysis of present system can be used as basic theoretical account.

The design starts after the demand analysis is complete and the cryptography begins after the design is complete. Once the scheduling is completed, the testing is done. In this theoretical account the sequence of activities performed in a package development undertaking are: –

  • Requirement Analysis
  • Undertaking Planing
  • System design
  • Detail design
  • Coding
  • Unit of measurement proving
  • System integrating & A ; proving

Here the additive ordination of these activities is critical. End of the stage and the end product of one stage is the input of other stage. The end product of each stage is to be consistent with the overall demand of the system. Some of the qualities of coiling theoretical account are besides incorporated like after the people concerned with the undertaking reappraisal completion of each of the stage the work done.

WATER FALL MODEL was being chosen because all demands were known beforehand and the aim of our package development is the computerization/automation of an already bing manual working system.

Requirements Specification

Hardware Requirements:

  • Pentium-IV Processor
  • RAM 128 MB
  • HDD 20 GB Hard Disk Space
  • Keyboard, Mouse, Monitor.

Software Requirements:

  • WINDOWS XP or Linux
  • Jdk1.5 or higher Software
  • Oracle10g.
  • Jar files related to Jdbc Type-IV Driver ( ojdbc14.jar )

Software Description

Introduction TO JAVA

About Java:

Harmonizing to James Gosling, Bill Joy, Guy Steele, Gilad Bracha ( May 2005 ) , The Java Language Specification Initially the linguistic communication was called as “ oak ” but it was renamed as “ Java ” in 1995. It is a all-purpose coincident class-based object-oriented scheduling linguistic communication. Due to its platform independence it allows the application developers to compose a plan one time and so be able to put to death it anyplace. As portion of jdk1.5 Sun has introduced some new characteristics. They are Generics, notes, asserts, autoboxing and unboxing, inactive imports, enum types, foreach cringles and variable arity methods. Java is strongly typed linguistic communication. It clearly distinguishes between compile clip mistakes and runtime mistakes. Compile clip usually consists of change overing the Java beginning codification into machine independent byte codification. Runtime activities are lading of.class files and linking of the categories needed to put to death a plan. To avoid the safety jobs expressed deallocation as in degree Celsius and c++ have been eliminated in Java utilizing the automatic storage direction, typically utilizing a refuse aggregator.

The linguistic communication does non let any insecure concepts, such as array entrees without index checking, since such insecure concepts would do a plan to act in an unspecified manner. C, C++ supports merely ASCII character set whereas Java supports Unicode characters. That ‘s the ground Java char informations type requires two bytes of memory. The chief use of this linguistic communication is to develop platform-independent applications. That could be executed in any machine irrespective of their system constellations and Operating Systems.

  1. Java is pure object Oriented Programming linguistic communication
  2. Java is platform independent and robust linguistic communication.
  3. Java is Multithreaded programming linguistic communication

Java can besides be embedded into the Hardware devices by utilizing J2ME API. ( Java 2 Micro Edition ) . Finally Java is to Internet Programming where degree Celsius was to Procedure Oriented Programming.

Importance of Java to the Internet

Java has had a profound consequence on the Internet. This is because ; java expands the Universe of objects that can travel approximately freely in Cyberspace. In a web, two classs of objects are transmitted between the waiter and the personal computing machine. They are inactive information and Dynamic active plans. in the countries of Security and chance. But Java addresses these concerns and by making so, has opened the door to an exciting new signifier of plan called the Applet.

Java Architecture

Java architecture consists of personal computer compiler, mactonish compiler, SPARC compiler they provide high acting environment for development of applications. Java achieves platform independence by bring forthing the category files. These category files can change over to machine codification by the translators. From java2 there will be a JIT compiler ( Just In Time Compiler ) which improves the public presentation of plan executing. JVM contains category stevedores which can lade the category files. JRE ( Java Runtime Environment ) provides the Environment to put to death Java plans.

Compilation of codification

Java Software ‘s might be different for different Operating Systems. The JVM is supposed to put to death the byte codification. Java Virtual Machine. is the machine which compiles codification for one machine and interpreted on all machines.

Features of Java

Simple:

Java was User friendly scheduling Language easy to larn and develop applications efficaciously. If anyone is holding experience or good cognition on C++ so larning Java will be easier for them. Learning Java is nil but larning the Object Oriented characteristics of C++ . Most of the Concepts of C++ which are confounding are removed in Java. And implemented in a good and Efficient mode.

Object oriented

Java is pure object oriented programming linguistic communication. Java can non be compared with any other scheduling linguistic communication. In the existent sense Java is non pure object oriented programming linguistic communication because of crude informations types. That is why the negligee categories were introduced to do Java as pure Object oriented programming linguistic communication. The Java object theoretical account is simple and easy to widen. Java provides the construct of bundles which contains the constitutional categories and interfaces which are really utile to develop applications.

Robust

The multi-platform environment of the web topographic points extraordinary demands on a plan, because the plan must put to death faithfully in a assortment of systems. The ability to make robust plans. Was given a high precedence in the design of Java. Java is purely typed linguistic communication ; it checks your codification at compile clip and runtime.

Java virtually eliminates the jobs of memory direction and trade location, which is wholly automatic. In a well-written Java plan, all run-time mistakes can and should be managed by your plan.

Garbage Collection

One of the hard occupations of C++ is GarbageCollection. In java Garbage aggregation is done for free whenever the Objects are no longer referenced. There is no demand of naming delete bid which is at that place in C++ .

Method /Behaviour and its Signature

When we making a category, we will stipulate the codification and informations that form a category. Elementss are called members of the category. The information defined in the category are referred to as member variables or case variables.

The codification that operates on that information is referred to as member methods or merely Methods.

  • Methods should return a value. Methods they may take statements or may non.
  • Methods which updates the member variables known as Mutator methods.
  • Methods which merely to entree the member variables known as replacement Methods.
  • Methods demands to execute a specific action based on their definitions.

About Constructors & A ; Memory Management

Builder

Harmonizing to Ian F.Darwin ( 2001 ) , Java Cookbook, Second Edition, A builder is a particular sort of method is ever invoked while making an object of category. If you do n’t specify any builders for your category, the compiler will provide a default builder in the category, which does nil. The default Constructor is besides described as the no-arg Constructor because it requires no statements to be specified when it is called. The Primary intent of a builder is to supply us with a agencies of initialising the case variables unambiguously for the object that is being created. [ 26 ]

A builder has 2 particular features that differentiate it from other category Methods:

  • A Constructor ne’er returns a value and we must non stipulate a return type-not even of type nothingness.
  • A builder ever has the same name as the category

A builder can hold any no. of Parameters known as Parameterized Constructors, including none. Builders are methods that can be overloaded, merely like any other method in a category. In most state of affairss, we will desire to bring forth objects of a category from different sets of initial specifying Data.

The Primary intent of the Constructor is to enable you to put initial values for the Fieldss. The Java Supports us to specify user defined builder besides known as expressed Constructor. In that instance the compiler ne’er provides default Constructor. This expressed builder is used to put to death some initial execute statements sing to category like linking to Database, to other system, opening a file… etc.

Types of Builder

From the above treatment builders are two types

  1. default Builders ( which is given by the digest Time )
  2. Explicit Constructor ( uservdefined Constructor )

Entree qualifiers to builders

Builders can be a private, public or default besides. Private Builders does n’t let to make cases.

Memory Management by JVM

Java Virtual Machines operate on Java bytecode, which is usually ( but non needfully ) generated fromjavasource codification.

Personal computer Register:

The Java Virtual Machine can back up many togss of executing at one time. Each JVM Thread has its ain Personal computer ( plan counter ) registry. At any point, each JVM Thread is put to deathing the codification of a individual method, the current method for that yarn. If that method is non Native, the Personal computer Register contains the reference of the JVM Instruction presently being executed. If the method presently being executed by the yarn is native, the value of the JVM ‘s Personal computer Register is vague.

Stack Area:

A Frame is used to hive away Data and partial consequences, every bit good as to Perform Dynamic Linking, return values for Methods, and dispatch exclusions.

The Java Stack is composed of stack frames ( or frames ) . A stack Frame contains the province of one Java Method supplication. When a Thread invokes a Method, the Virtual Machine dads and discards the frame for that Method.

Heap Area:

The Heap is the Runtime informations country from which memory for all category cases and array is allocated.

The Heap is created on Virtual machine start up. Heap storage for objects is reclaimed by an automatic storage direction system ( known as a refuse aggregator ) ; objects are ne’er explicitly de-allocated. The JVM assumes no peculiar type of automatic storage Management System, and the storage direction Technique may be chosen harmonizing to the implementer ‘s system demands. The Heap may be of a fixed size or may be expanded as required by the Computation and may be contracted if a larger heap becomes unneeded.

Method Area:

When the Virtual Machine loads a category file, it parses information about a type from the Binary informations contained in the category file. It places this type information into the Method Area. It shops per -class constructions such as the runtime changeless pool, field and method informations, and the codification for methods and builders, including the particular Methods used in category and case low-level formatting and interface type low-level formatting.

Runtime Changeless Pool:

Each Runtime changeless pool is allocated from the JVM ‘s method country. The Runtime changeless pool for a category or interface is constructed when the category or interface is created by the JVM.

A Runtime Constant pool is a pre-class or pre interface runtime representation of the changeless pool tabular array in category file.

It contains several sorts of invariables, Ranging from Numeric misprints known as Compile clip to Method and field mentions that must be resolved at tally Time.

Garbage Object:

c++ and similar linguistic communications depends on the developer to explicitly liberate up all dynamically allocated Memory. Failure to make that consequences in memory leaks. Although Memory leaks may non be debatable in short running Programs, they can do long-running plans ( such as web waiters ) . In c++ dynamically allocated objects must be manually released by usage of a delete operator.

Java relies on a JVM ‘s automated Garbage Collections Capabilities to extinguish Memory leaks by liberating up dynamically allocated Memory. In Contrast, Java ne’er requires the coder to explicitly apportion or let go of Memory, forestalling many of the Problems that can happen.

Alternatively Java automatically allocates Memory when u create an Object, and Java will let go of the Memory when Mentions to the object no longer be.

Java uses what ‘s known as a Garbage Collector to supervise a Java plan while it runs and automatically releases memory used by objects that are no longer in usage. Java uses a series of soft arrows to maintain path of object mentions and an object Table to map those soft arrows to the object mentions. Using soft arrows allows java Garbage Collector to run in background utilizing a separate Thread, and it can analyze one object at a Time. The Garbage Collector can tag, take, travel, or examine objects by altering the object table entries.

The Garbage Collector runs on its ain, and expressed refuse aggregator petitions are by and large non necessary. We can bespeak that the refuse aggregator run by raising the inactive gigahertz ( ) method in the System category, through there is no warrant that a given object will be refuse collected at any given Time..

Some times an object will necessitate to execute some actions when it is destroyed by Garbage Collector.

Eg: If an Object is keeping some non -java resources such as file grip, database connexions or character fount, so as a developer we should take attention about the Free the resources before an object is destroyed. To manage this state of affairs java provides a Mechanism called finalisation. The Garbage Collector runs finalise ( ) methods before destroy the object,

This is defined in Object category is by default most ace category for every category in Java. About inactive Modifier: inactive is one of the entree qualifiers in Java which provides planetary functionality for the category.

We can use inactive qualifier as,

  • inactive variables
  • inactive methods
  • inactive inner categories
  • inactive blocks
  • inactive imports

inactive variable:

This sort of variable is referred to as a category variable, because the field belongs to the category and non to any peculiar object, all objects of the category will portion it. These Fieldss are besides referred to as inactive Fieldss because we use the inactive keyword when we declare them. Non-static Fieldss besides called case variables- Each object of the category will hold its ain transcript of each of the non-static Fieldss or case variables that appear in the category definition. Each Object will hold its ain values for each case variable. The name case variable originates from fact that an object is an case or happenings of a category, and the values stored in the case variables for the object differentiate the object from others of the same category type. Each category variable exists even if no objects of the category have been created. Class variables belonging to cases of that category. If the value of a inactive field is changed, the new value is available every bit in all the objects of the category. These variables are utile to number the no. of objects, where of all time we want to portion a variable to all its objects.

Inactive Methods:

The Methods that you define for a category provide the actions that can be carried out utilizing the variables specified in the category definition. Like category variables, category methods are declared utilizing the keyword inactive, so they are sometimes referred to as inactive methods. Inactive methods are used to execute some operations on inactive variables particularly to execute planetary operations with purpose of case belongingss. Inactive method context known as inactive context, here which does n’t let to entree case variables and does n’t let to put to death inactive methods. To put to death inactive methods no demand to apportion the memory besides.

Inactive Imports:

JDK 5 added a new characteristic to java called inactive import that expands the capablenesss of the import keyword. Here an import statement can be used to import the inactive members of a category or interface. When utilizing inactive import, it is possible to mention to inactive members straight by their names, without holding to measure up them with the name or their category. In Java library we have a Math category in java.lang. * bundle, Which contains methods for executing basic numeral operations such as the simple exponential, logarithm, square root, and Trigonometric Functions. In this all are Inactive Methods.

Java Swings

Harmonizing to John Zukowski ( 2005 ) , The Definitive Guide to Java Swing, Third Edition Swing, provide improved constituents that enhance the expression and functionality of GUIs. Swinging can be used to develop Standalone swing GUI Applications. It is developed on model/view design architecture. Swing ‘s are platform independent where as AWT ‘s are platform dependant because they use some native libraries to develop the GUI.

In Swing Model/view design, the “ position portion ” is implemented with a constituent object and the UI object. Whereas “ model portion ” is implemented by a theoretical account object and a alteration hearer object.

Swinging is non the replacing for AWT ( Abstract window tool Kit ) . Swinging is built on top of AWT and is wholly written in Java, utilizing AWT ‘s lightweight constituent support. The Swinging constituents can custom-make both their visual aspect and behaviour with their architecture. Components from AWT and Swing can be assorted, AWTs allow us to add swing constituents. For illustration, swing constituents like JButton JTextField and JCheckbox could be used with standard AWT labels, TextFields and scrollbars plans. You could subclass the bing Swing UI, theoretical account, or alteration hearer categories without holding to reinvent the full execution. Swinging can hold the capableness of replacing these objects dynamically.

Java Swinging Components:

  • JPanel: Itis the Swing ‘s version of AWT Panel that uses the same default layout, FlowLayout. JPanel is inherited straight from JComponent.
  • JFrame: It is Swinging ‘s version of Frame. The constituents which are added to the frame can be called as its contents. These constituents were managed by the ContentPane. To add a constituent to a JFrame, we must utilize its contentPane alternatively.
  • JInternalFrame: It is confined to a seeable country of a container it is placed in. It can be layered, maximized, iconified.
  • JWindow: It is Swinging ‘s version of Window. It uses BorderLayout by default.
  • JDialog: It is Swinging ‘s version of Dialog and is inherited straight from that category. It besides uses BorderLayout by default. Similar to JFrame, JWindow, JDialog contains a rootPane hierarchy including a contentPane, and it allows layered and glass window glasss. All duologues are modal, which means the current yarn is blocked until user interaction with it has been completed. JDialog category is intended as the footing for making custom duologues.
  • JLabel: Inherited from JComponent, It is used to make text labels.
  • JButton: The abstract category AbstractButton extends category JComponent and provides a foundation for a household of button categories.
  • JTextField: Allows user to give input values, redacting of a individual line of text. New characteristics include the ability to warrant the text left, right, or centre, and to put the text ‘s fount.
  • JPasswordField: A direct subclass of JTextField. This can stamp down the show of input. Each character entered can be replaced by an echo character.
  • This is used to maintain the information confidential. Chiefly used for watchwords, by default, the echo character is the star, * .
  • JTextArea: Allows for come ining multiple rows of text. JTextArea can be used in concurrence with category JScrollPane to accomplish scrolling. It is chiefly used for come ining reference informations. JScrollPanes can be used if necessary in the TextFields.
  • JRadioButton: It is similar to JCheckbox, except for the default icon for each category. A set of wireless buttons can be associated as a group in which merely one button at a clip can be selected.
  • JCheckBox: It is non a member of a checkbox group. A checkbox can be selected and deselected, and it besides displays its current province.
  • JComboBox: It is like a bead down list. You can snap on the drop-down pointer and choose an point from a list. It is chiefly used to take state as input value. Then one has to utilize this ComboBox.
  • JList: Itprovides a scrollable set of points from which one or more may be selected. JList can be inhabited from an Array or Vector. JList does non
  • support scrolling straight, unless it must be associated with a scrollpane. JList actions are handled utilizing ListSelectionListener.
  • JTabbedPane: It contains a check that can hold a tool tip and a mnemonic, and it can expose both text and image.
  • JToolbar: It is similar to standard tool saloon of MsOffice. It contains a figure of constituents which is similar to some sort of button which can besides include centrifuges to group same components together within the toolbar.
  • FlowLayout: It arranges swing constituents from left to right until there ‘s no more infinite available. Then it begins a new row below it and moves
  • from left to compensate once more.
  • BorderLayout: It places swing constituents in the North, South, East, West and centre of a container. You can add horizontal and perpendicular spreads between
  • the countries.
  • GridLayout: It is a layout director that places container ‘s constituents in a rectangular grid. The container is divided into equal-sized rectangles,
  • and one constituent is placed per rectangle.
  • GridBagLayout: It is a layout director that lays out a container ‘s constituents in a grid of cells with each constituent busying one or more cells,
  • called its show country. The show country aligns constituents vertically and horizontally, without necessitating that the constituents be of the same size.
  • JMenubar: It can incorporate several JMenu ‘s. Each of the JMenu ‘s can incorporate a series of JMenuItem ‘s that you can choose. Swinging provides support for
  • pull-down and popup bill of fare.

The Model-View-Controller Architecture in Swinging

As the cardinal design swing utilizations model-view-controller architecture behind each of its constituents. MVC breaks GUI constituents into three elements depending the behaviour of the constituents. This design combines the position and the accountant into a individual component that draws the constituent to the screen and handles the GUI events known as the User Interface delegate.

JDBC

What is JDBC?

Harmonizing to George Reese ( 2000 ) , Database programming with JDBC and Java, Second Edition, Any relational database. One can compose a individual plan utilizing the JDBC API, and the JDBC is a Java Api for put to deathing SQL, Statements ( As a point of involvement JDBC is trademarked name and is non an acronym ; however, Jdbc is frequently thought of as standing for Java Database Connectivity. It consists of a set of categories and interfaces written in the Java Programming linguistic communication. JDBC provides a standard API for tool/database developers and makes it possible to compose database applications utilizing a pure Java API

Using JDBC, it is easy to direct SQL statements to virtually plan will be able to direct SQL.statements to the appropriate database. The Combination of Java and JDBC lets a coder writes it one time and run it anyplace.

What Does JDBC Do?

  • Establish a connexion with a database
  • Send SQL statements
  • Procedure the consequences
  • JDBC Driver Types
  • The JDBC drivers that we are cognizant of this clip tantrum into one of four classs
  • JDBC-ODBC Bridge plus ODBC driver
  • Native-API party-java driver
  • JDBC-Net pure Java driver
  • Native-protocol pure Java driver

An single database system is accessed via a specific JDBC driver that implements the java.sql.Driver interface. Drivers exist for about all-popular RDBMS systems, through few are available for free. Sun bundles a free JDBC-ODBC span driver with the JDK to let entree to a standard ODBC, information beginnings, such as a Microsoft Access database, Sun advises against utilizing the span driver for anything other than development and really limited development.

Assorted stairss involved in linking to DB are:

  1. Establish one web connexion to DB utilizing hostname, port figure, username and watchword
  2. one map call is required to direct and put to death SQL statement ( DDL- CREATE, ALTER, DROP ; DML- INSERT, UPDATE, DELETE ) on DB, this map must return us one whole number value ( no of rows updated/deleted on DB ) or Boolean value ( true/false ) indicate SQL bid executing is successful or non
  3. One map call is required to direct and put to death SELECT statement on DB and must return array of rows and columns
  4. And eventually one map call to unplug from DB.

Each DB is implemented in a C/Java scheduling linguistic communication. Their map names are something as follows:

  • In instance of Prophet: OCIConnect ( ) , OCIExecute ( ) , OCIFetch ( ) , OCIDisconnect ( )
  • In instance of DB2 database: SQLConnect ( ) , SQLExecute ( ) , SQLFetch ( ) , SQLDisconnect ( )

Hence client who wants to link to DB must compose a separate plan for each DB. Write separate plan for each DB is a codification repetition/redundancy. To decide this job Microsoft developed one ODBC driver for each DB in association with DB sellers.

In ODBC package all the DB seller maps are standardized and compose a separate driver for each DB. ODBC driver contains each ODBC map mapped to DB degree Celsius map. Like that each ODBC driver contains many ODB C maps mapped to DB C maps. Hence clients who want to link to different databases must utilize ODBC driver, name the same map that converts map call to DB map call.

JDBC Drivers

Type I-JDBC-ODBC Bridge Driver

Type I drivers use a span engineering to link a Java client to an ODBC database service. Sun ‘s JDBC-ODBC span is the most common type 01 driver. These drivers implemented utilizing native codification. ODBC software/ODBC suite is a aggregation of ODBC drivers for many databases. Clients like VB ( Visual Basic ) , PB ( Power Builder ) front terminal tools can straight entree DB C map calls.

But how java clients can entree DB C map calls?

To entree C map calls from Java plan one.dll file ( native library file ) must be loaded and utilizing JNI ( Java Native Interface ) scheduling must be used to name C maps. Hence for Java clients Sun provided one Java category that contains java methods. Each Java method in bend entree C map of ODBC driver. This driver name is JDBC-ODBC driver besides called as JDBC Type I driver. This driver is provided by Sun Microsystems and this driver category comes with JDK package. Hence clients need non hold to put in any 3rd party package ‘s to utilize this driver.

The advantages of Type I driver is:

  1. Through individual JDBC driver category we are linking to ODBC package, that package linking us to many DBs. That means Type I driver is a individual interface to link to many DBs.
  2. ODBC driver for DB comes with DB installing ; JDBC-ODBC driver comes with JDK installing. Hence we need non hold to put in any separate package to utilize this driver.

The disadvantages of this driver:

  1. We can utilize this driver merely on Windows OS. Hence it is platform / OS particular. With this driver if we write a JDBC plan the plan runs merely on Windowss OS but non on any other OS. The plan is non portable to all the OSs.
  2. We can link merely to local DBs ( DB running on the same system ) .

Type II-Native-API party-java Driver

Type II drivers wrap a thin bed of Java around database-specific native codification libraries for Oracle databases, the native codification libraries might be based on the OCI ( Oracle name Interface ) libraries, which were originally designed for c/c++ coders, Because type-II drivers are implemented utilizing native codification. in some instances they have better public presentation than their all-java counter parts. They add an component of hazard, nevertheless, because a defect in a driver ‘s native codification subdivision can crash the full waiter. This driver is provided by DB seller. During DB package installing ( oracle package ) , this driver is besides installed on our machine. This driver contains the same figure of java methods as what JDBC-ODBC driver contains, each Java method is converted into DB C map call. It is a direct call to DB without ODBC or any other package interference/involvement. Hence this driver is portable to run all the OSs. That means when prophet DB installed on Windows OS, driver category installs along with DB installing. The same Oracle DB if installed on Unix OS, driver installs along with DB installing once more. The advantages of this frogman are: I ) Portable to run on all Operating systems. two ) Fastest driver among all 4 JDBC drivers The disadvantages of this driver are: I ) For every DB we need a separate Driver category. Not a common interface to link to all the DBs. two ) Still this driver besides connect us to local DBs, with this driver we can link to remote databases.

Type III-Net-Protocol All-Java Driver

Type III drivers communicate via a generic web protocol to a piece of usage middleware. The middleware constituent might utilize any type of driver to supply the existent database entree. This driver methods are besides strictly implemented in Java scheduling linguistic communication same as Type IV driver. But the difference is if the DB seller do non supply Type IV driver to link to their DB on remote system, we must utilize 3rd party seller driver. This driver seller provides one socket plan on waiter system that takes username, watchword and ODBC ‘C ‘ map and connects to DB via ODBC package. On client system this driver seller must supply one Java category that uses Java socket & A ; I/O API to link to server side socket and sends ODBC ‘C ‘ map calls. The advantages are:

  1. Light weight
  2. Connect to remote DBs
  3. Portable to all the Operating systems
  4. Single interface to link to multiple DBs
  5. In absence of Type IV, Type III is the lone option to link to remote DBs

Disadvantages are:

  1. Slower than Type IV
  2. Separate licensed package demand to be purchased to utilize this driver.

Type-IV-native-protocol All-java Driver

Type IV drivers understand database-specific networking. protocols and can entree the database straight without any extra package. JDBC Type I & A ; II drivers are called as heavy weight drivers because in Type 01 driver Java methods entree ODBC ‘C ‘ maps and in Type II the driver category methods entree DB ‘C ‘ maps. Whenever Java methods entree ‘C ‘ maps such methods are called heavy weight methods. If method execution is strictly written in Java programming linguistic communication such methods are called as light weight methods. Type III & A ; IV drivers are light weight drivers. The term heavy weight indicates that Java methods dependants on other maps to run but non separately. In this driver the methods alternatively of accessing ‘C ‘ maps of DB, Java socket API & A ; I/O API is used connect to DB. While linking to DB Java socket takes hostname & A ; port figure for connectivity and so utilizing I/O API username, watchword and DB ‘C ‘ map name are send to server side socket. Server side socket invokes ‘C ‘ map on DB. Socket API is used to implement protocol scheduling. This driver uses Java socket & A ; I/O API to direct C map calls to server. Because it is utilizing java socket API/java native protocol API in the execution of driver, hence it is called as “ Java Native protocol Driver ” . This driver is besides provided by DB seller and this driver category comes with DB package installing. Type II driver is communicate with local DB and Type IV driver is to pass on with distant database. The Advantages are:

  1. Light weight
  2. We can entree both local and distant DBs
  3. Portable to run all OSs

The Disadvantages of this driver are:

  1. Slower than heavy weight drivers
  2. For each DB separate JDBC driver is required. The driver contain.jar file must be updated in CLASSPATH.

Statement & A ; PreparedStatement

Soon after acquiring connexion object, developer must take which Statement object is required to put to death SQL bid on the DB.

Statement interface is holding two method

  1. executeUpdate ( ) to put to death UPDATABLE operations on DB ( CREATE, ALTER, DROP, INSERT, UPDATE & A ; DELETE )
  2. executeQuery ( ) to put to death QUERY operations on DB ( SELECT )

Statement must be used by developer if every clip new SQL statement privation to be executed on DB. If Statement is used to put to death update operation, for case stmt.executeUpdate ( “ INSERT INTO class VALUES ( 1, ‘Songs ‘ , ‘Songs ‘ ) ” ) ;

Statement is recommended if developer want to direct different SQL bids to DB but non the same SQL bid for many times. If the same SQL bid is send to DB with different values utilizing Statement the same proofs, transition, digest and executing takes topographic point once more and once more that reduces the public presentation of the JDBC application.

PreparedStatement

Developer must utilize this interface to put to death the same SQL bid with different values more than one time on DB. If PreparedStatement is used DB verifies the SQL sentence structure and confirmation with table construction, Converts into SQL executing program, compiles the program, and returns the executing program id to JDBC plan, In JDBC plan the program Idaho is received by PreparedStatement object, Hence we can state PreparedStatement is a arrow to SQL executing plan/it is a mention indicating to SQL program, PreparedStatement is holding one set method for each datatype to go through values into IN parametric quantities. For case to go through int value @ foremost parametric quantity

ResultSet

ResultSet is a arrow to DB buffer. During stmt.executeQuery ( ) method with SELECT statement on DB, DB verifies SQL statement and converts SQL statement into executing program ( I/O plan ) . Execution program executes and bring records from DB file system ( users.dbf ) to DB buffer ( into RAM ) . The location where the records are fetched in RAM, the reference of the location is returned to JDBC plan, that reference is called as ResultSet object. Initially ResultSet points to before first record in DB buffer. One method given in resultset object called following ( ) sends petition from JDBC plan to DB buffer and moves the cursor place from beforeFirst record to following record/first record and returns true if record exist in that place. By seting rs.next ( ) method in while cringle, we will be able fetch records till terminal of the buffer/last record. Until last record rs.next ( ) method returns true. After last record the following ( ) method petition on resultset object will return false and the piece cringle issues. During each following ( ) method call one n/w call goes from JDBC plan to DB buffer, that call consumes DB connexion. During each following ( ) method we will indicate to one record, each record contains more than one column. To bring columns one get method is given for each information type. For case getInt ( ) method is given to bring int column. Similar maps are given to bring byte, short, int, long, float, dual, char, boolean, String, Object, day of the month, timestamp, blob, CLOB, binarystream and characterstreams. Each get method takes column index or column name as statement. For case to bring int column from first index rs.getInt ( 1 ) method must be called, to bring catid as int value we can besides bespeak rs.getInt ( “ catid ” )

The restrictions of resultset are

Since each method call on ResultSet object ( following ( ) and getInt ( ) methods ) uses DB connexion, we can utilize merely one ResultSet object at a clip on a individual DB connexion.

Before utilizing resultset if we open one more resultset object on the same DB connexion, the first resultset object implicitly closes and does n’t do any mistake, but rs.next ( ) on first resultset object returns false and no individual record can be fetched from first resultset object.

Hence on a individual DB connexion we must utilize merely one ResultSet object at a clip. Once after completion of first resultset, we can open one more resultset object on the same DB connexion.

If more than one ResultSet object is required at a clip for each ResultSet we must open a separate DB connexion and statement object for each ResultSet object.

ResultSet besides mandates that the record must be fetched from beforeFirst record to afterLast record in sequence, this is called as “ Forward Fetch ” . and during arrow to each record the columns must besides be fetched in sequence ( first column, 2nd column and so on ) .

JDBC 2.0 ResultSet

JDBC2.0 ResultSet besides called as Scrollable and Updatable ResultSet. This resultset is introduced in JDK 1.2. The intent scrollable ResultSet is the information one time fetched from DB file system to DB buffer can be read for any figure of times, in any way ( frontward and backward way ) . And besides this resultset object can be made sensitive from others alterations ( agencies after we fetch informations from the DB, though the information is modified by others in the DB file system, the alteration instantly updates in our DB buffer ) .

The scrollable maps introduced in resultset are:

  1. beforeFirst ( )
  2. foremost ( )
  3. old ( )
  4. following ( )
  5. last ( )
  6. afterLast ( )
  7. absolute ( int rowno )

To make such a scrollable and sensitive resultset object, we must inform it to statement object as below:

stmt=con.createStatement ( ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY ) ;

Prophet

Prophet is a relational database direction system, which organizes informations in the signifier of tabular arraies. Oracle is one of many database waiters based on RDBMS theoretical account, which manages a visionary of informations that attends three specific things-data constructions, informations unity and information use.

With prophet concerted waiter engineering we can recognize the benefits of unfastened, relational systems for all the applications. Oracle makes efficient usage of all systems resources, on all hardware architecture ; to present odd public presentation, monetary value public presentation and scalability. Any DBMS to be called as RDBMS has to fulfill Dr.E.F.Codd ‘s regulations.

Features of Prophet:

Portable

The Oracle RDBMS is available on broad scope of platforms runing from Personal computers to super computing machines and as a multi user loadable faculty for Novel NetWare, if you develop application on system you can run the same application on other systems without any alterations.

Compatible

Oracle bids can be used for pass oning with IBM DB2 mainframe RDBMS that is different from Oracle, which is Oracle compatible with DB2. Oracle RDBMS is a high public presentation mistake tolerant DBMS, which is specially designed for on-line dealing processing and for managing big database applications.

Multithreaded Server Architecture

Oracle adaptable multithreaded server architecture delivers scalable high public presentation for really big figure of users on all hardware architecture including symmetric multiprocessors ( sumps ) and slackly conjugate multiprocessors. Performance is achieved by extinguishing CPU, I/O, memory and operating system constrictions and by optimising the Oracle DBMS server code to extinguish all internal constrictions.

Prophet has become the most popular RDBMS in the market because of its easiness of usage

  • Client/server architecture.
  • Data independency.
  • Guaranting informations unity and informations security.
  • Pull offing informations concurrence.
  • Parallel treating support for velocity up informations entry and on-line dealing processing used for applications.
  • DB processs, maps and bundles.

Planing the solution

Unified Modeling Language:

BERND BRUEGGE, ALLEN H. DUTOIT ( 2010 ) , Object Oriented Software Engineering Using UML, Patterns, Java, Third Edition, The UML ( Unified Modeling Language ) is really much useful for an package applied scientist to show an analytical procedure theoretical account utilizing the mold notation that is validated by a set of matter-of-fact regulations semantic regulations.

A UML scheme is represented utilizing five different positions that describe the scheme from clearly different angles. Each position is defined by a set of diagram, which discussed below

User Model View

  • This position denotes the scheme from the user ‘s position.
  • The analysis denotes the usage portion from the end-users point of position.

Structural theoretical account position

  • In this theoretical account the informations and functionality can be acquired from within the system.
  • This theoretical account position is used to pattern the inactive constructions.

Behavioral Model View

It represents the dynamic behaviour as parts of the scheme, stand foring the interactions of aggregation between assorted structural elements described in the user theoretical account and structural theoretical account position.

Implementation Model View

The structural and behavioural parts of the system are represented as they are to be developed.

Environmental Model View

In this the structural and behavioural facets of the environment in which the system is to be implemented are represented.

UML is specifically constructed through two different spheres they are:

  • Analysis patterning that focuses on the user theoretical account and structural theoretical account positions of the system.
  • Design mold, which focuses on the behavioural mold, execution mold and environmental theoretical account positions.

Use Case Diagram

Use instance Diagrams represent the functionality of the system. Use instances focus on the behaviour of the system from external point of position. Use instances are used during demands garnering and analysis to demo the functionality of the system. Use instances focus on the behaviour of the system from external point of position.

Actors are like external entities that interact with the system. Examples of histrions administrator, bank client, another system like cardinal database… etc. , can be some of the sample histrions for any common application.

Sequence Diagram for Admin faculty

Sequence diagrams represent the simple interaction between assorted objects arranged in a clip sequence. It besides shows the objects their line of life and the exchange of messages between objects. It may besides demo the creative activity of new objects. As show in the holla it shows if the object is activated with a rectangular line of life. When the object is non active, it merely has a dashed line of life. In this application User, Login, Company Details, Agency Details, Product Details, Order Details, Reports are the assorted objects and these objects are pass oning utilizing the messages.

Execution

It is nil but merely a program to implement the system design. Already I designed the proposed system, now this is one of the degree gives elaborate information about how the system should implement based on the design considerations. In the Software, the scheduling linguistic communications are the figure of execution in package development.

  • I implemented this application utilizing JAVA swings, JDBC API.
  • Swinging API is more dependable and consistent GUI for all platforms i.e. there is no in visual aspect even executes on many more platforms, where as AWT constituents with specific expression & A ; experience i.e. alterations their visual aspect for one platform to another platform.
  • Swinging constituents have their ain expression & A ; feel, where as AWT with their native GUI.
  • Swinging with efficient event managing theoretical account than AWT event managing theoretical account. Swinging with MVC form allows to custom-make the theoretical account bed of the GUI constituent, where as AWT does n’t.

In this execution the existent cryptography of undertaking is traveling to get down like with pieces of plans. Once the scheduling is over so these are all little units integrated in the following stage. In our undertaking we have 4 faculties like,

  • Stock Maintenance
  • Ordering
  • Charge.
  • Reports

Each faculty consist pieces ( or ) units of plans.

Execution of Swing MVC

We purely implemented swing MVC architecture in this application. The application has been implemented by following the undermentioned guidelines.

  • Implemented wholly in Java to advance cross platform consistence and easier of care.
  • Used swing API capable of back uping multiple expression and feels. So that the developers and terminal users would non be locked into a individual expression and feel.
  • Without utilizing highest degree API, it enables the power of a theoretical account driver scheduling.
  • It has been implemented utilizing JavaBeans design rules to guarantee that the constituents behave good in IDEs and other builder tools.
  • And has compatibility with AWT API.

Position

View portion is responsible for the presentation of constituents with which the terminal user can interact.

Accountant

Controller portion is responsible for listening the user petition and fire the corresponding event. And Controller can read the informations provided by terminal user, validate the informations and procedure the informations harmonizing to the client demand or harmonizing to the concern logic, and so eventually manus over that processed informations to pattern bed for continuity of informations.

Model

Model bed is responsible for accepting the information from the control bed and hive away the informations for good in some lasting storage devices. Here this application utilizing Oracle database. Here we are utilizing DAO ( Data Access Object ) and DTO ( Data Transfer Object ) in this bed for theoretical account operations.

Java Naming conventions & A ; Coding Standards

Java linguistic communication developers have given many cryptography criterions. This application has developed by following the Java cryptography criterions and appellative conventions. It covers while planing file names, indenture, remarks, declaration, statements, giving white infinites and by following good scheduling patterns.

Refactoring

  • Refactoring is a disciplined technique for reconstituting an bing organic structure of codification
  • Alternatively of utilizing a value many times in the codification, we can do it a changeless and utilize it.

Minimized Modular Dependences

  • Dependences between faculties are really less. As Admin faculty is independent on Employee faculty.
  • Related categories and interfaces are kept in separate faculty.

OOP Guidelines Applied

  • Compact categories
  • Inheritance is used to accomplish reusability of codification and maintainability
  • Collection is used in scheme design form
  • Interfaces at the top of hierarchy
  • Good communicating b/w objects
  • Low matching & A ; high coherence.
  • High coherence

Design Pattern

A design form is a exemplary solution for often happening jobs while a package application is developing.

Execution of Design Patterns

The list of design forms has been implemented in this undertaking.

Factory Design Pattern

In this application, Factory design form has been implemented to obtain the database connexion object. In DBConn category we have a inactive method called getConnection ( ) which returns the database object.

DAO ( Data Access Object ) Design Pattern

The Java Data Access Object design form ( Java DAO ) is an of import constituent in concern applications. Most of the concern application needs to entree the relational or object databases and java platform provides many techniques for accessing this information. The oldest and most mature technique is to utilize the Java Database Connectivity ( JDBC ) API, which provides the capableness to put to death SQL questions against a database and so bring the consequences, one column at a clip. In this application Data Access Object design form has been implemented. The bundle edu.pharma.model.dao contains all the DAO categories. The thought behind this is alternatively of concern bed straight communicate with the database, the sphere logic speaks to DAO bed. This DAO bed communicated with the underlying continuity system ; here we are utilizing Oracle 10g. The advantage of utilizing this design form is in future if we want to alter the concern logic or front terminal design we need non hold to alter the continuity logic.

DTO ( Data Transfer Object ) Design Pattern

Data Transfer Objects besides known as Value Objects ( VO ) is a package design form used to reassign the informations between package application subsystems. DTOs are often used in concurrence with Data Access Object to recover informations from database and prevail the processed information into database. The lone difference between DTOs and DAOs is that DTOs does n’t hold any behavior means this is utile to reassign the object province from one constituent to another constituent. In this application we used DTO design form every bit good. The bundle edu.pharma.model.dto contains all the DTO categories related to the application.

Module Description

The followers are the list of faculties in this application.

  • Stock care
  • Ordering
  • Bill Generation
  • Reports

The decision maker is responsible for the direction of whole application. Merely authorised users can come in into the decision maker screen. And the decision maker can execute the undermentioned undertakings

  • Adding the new company inside informations, update the company inside informations and cancel the company inside informations.
  • Adding the new bureaus, updating the bureaus and can cancel the bureau inside informations.
  • Salvage the new merchandise inside informations in database, and canceling the merchandise inside informations from the database.
  • The decision maker can put the orders ( salvage the order inside informations in database ) and can call off the order.
  • The decision maker can besides see the studies of stock, orders, company inside informations, bureau inside informations, client inside informations and gross revenues inside informations every bit good.

Employee is responsible for salvaging the new client inside informations update the client inside informations and cancel the client inside informations. The employee faculty is responsible for medical measure coevals.

Stock care: This characteristic can be accessible for decision maker merely. The decision maker can add the new merchandise inside informations in database and can cancel the information sing peculiar merchandises.

Ordering: The decision maker is responsible for puting the order for peculiar merchandises and can call off the order placed to peculiar bureau.

Bill Generation: This faculty allows the employees to bring forth the medical measure.

Orders: In this faculty decision maker can see the studies sing company inside informations, bureau inside informations, client inside informations, merchandise inside informations, order inside informations and gross revenues inside informations every bit good.

Functions of Admin user

  • Keeping company and bureau inside informations
  • Stock care
  • Care of orders
  • Can see the studies of Gross saless, Stock and Orders every bit good.

Functions of Employee user

  • Care of client inside informations
  • Bill coevals

Features provided in this package

  • While salvaging the merchandise inside informations into database, we have to choose the maker company name and from which we purchased that merchandise. In future if we want to see a peculiar merchandises maker inside informations we can obtain from stock study. And from which bureau we purchased that merchandise, that inside informations besides available. Similarly for orders.
  • It facilitates studies for Stock available, Gross saless, orders, and some more inside informations about companies, bureaus, clients every bit good.
  • While bring forthing the measure, the user can see the entire sum of the measure after every merchandise entry.
  • After completion of all the client requested merchandises entry, if client want to call off some merchandises, the employee can choose the unwanted merchandises and delete from the list. After that merely the gross revenues inside informations will be stored in database.

Validations

Validations helps the terminal user to give the correct input for the processing of the information. Depending on the demands there are different types of proofs, some of the proofs used in this application are Date proof, bar of subjecting signifier without giving input ( to avoid void informations ) , Number format proofs.

  1. Harmonizing to the demand day of the month proof has been performed. In our application fabrication day of the month of a merchandise should non be greater than or equal to expiry day of the month of that merchandise. Similarly order day of the month of the merchandise should non be greater than or equal to the due day of the month.
  2. While come ining the merchandise inside informations measure, monetary value, MRP should non be threading informations they should be Numeric informations merely.
  3. The terminal user should come in the information in all the compulsory Fieldss, so that we can forestall the void information. All the needed proofs has been implemented in this application harmonizing to the sphere demands.

Security

The Security provides controls to entree information available in the application. It deals with user degree security for the other faculties and their maps. Each user should hold entree to a predefined set of actions ( add/modify/delete/query ) on assorted maps in a given faculty. User-defined mistake and aid messages besides have been maintained and customized in this application.

Authentication

Authentication is the procedure of finding whether person or something can be accessible by the attested users or non. For this we provided user name and watchwords to entree the resources.

In this application we are supplying user name, watchword and function, end user has to supply the user name, watchword and choose the appropriate function. The terminal user input informations will be accessed and compared with the informations bing in the database, so merely attested users merely can entree this application. Role determines the mandate, in the application we are holding two functions Admin function and Employee function. Authorization ensures that merely the intended users are accessing the resources. Admin function holding different entree privileges and employee function will be holding different entree privileges.

Testing

Introduction to Testing:

Testing is a procedure, which reveals mistakes in the plan. It is the major quality step employed during package development. During proving, the plan is executed with a set of trial instances and the end product of the plan for the trial instances is evaluated to find if the plan is executing as it is expected to execute.

Testing IN STRATEGIES

In order to do certain that the system does non hold mistakes, the different degrees of proving schemes that are applied at differing stages of package development are:

Unit of measurement Testing:

Unit of measurement Testing is done on single faculties as they are completed and become feasible. It is confined merely to the interior decorator ‘s demands.

In this stage each unit is tested for their functionality. For Example, Accept Order functionality tested whether its functionality performs in successful mode or non. This sort of functional testing for each functionality known as Unit Testing. This proving ensures whether the faculty ( or ) functionality reaches to their functional or non. With this we can get the better of the bugs in the undertaking, helps to develop a bug free system. For this we can utilize JUnit trial tool

Each faculty can be tested utilizing the undermentioned two Schemes:

Black Box Testing:

In this scheme some trial instances are generated as input conditions that to the full execute all functional demands for the plan. This testing has been utilizations to happen mistakes in the undermentioned classs:

  • Incorrect or losing maps
  • Interface mistakes
  • Mistakes in information construction or external database entree
  • Performance mistakes
  • Low-level formatting and expiration mistakes.

In this proving merely the end product is checked for rightness.

The logical flow of the information is non checked.

White Box testing:

In this the trial instances are generated on the logic of each faculty by pulling flow graphs of that faculty and logical determinations are tested on all the instances. It has been utilizations to bring forth the trial instances in the undermentioned instances:

  • Guarantee that all independent waies have been executed.
  • Execute all logical determinations on their true and false Sides.
  • Execute all cringles at their boundaries and within their operational bounds
  • Execute internal informations constructions to guarantee their cogency.

Integrating Testing:

Integration proving ensures that package and subsystems work together a whole. It tests the interface of all the faculties to do certain that the faculties behave decently when integrated together.

System Testing:

Involves in-house testing of the full system before bringing to the user. Its purpose is to fulfill the user the system meets all demands of the client ‘s specifications.

Credence Testing:

It is a pre-delivery testing in which full system is tested at client ‘s site on existent universe informations to happen mistakes.

Test Approach:

Testing can be done in two ways:

  • Bottom up attack
  • Top down attack

Bottom up Approach:

Testing can be performed get downing from smallest and lowest degree faculties and continuing one at a clip. For each faculty in underside up proving a short plan executes the faculty and provides the needed informations so that the faculty is asked to execute the manner it will when embedded within the larger system. When bottom degree faculties are tested attending turns to those on the following degree that use the lower degree 1s they are tested separately and so linked with the antecedently examined lower degree faculties.

Top down attack:

This type of proving starts from upper degree faculties. Since the elaborate activities normally performed in the lower degree modus operandis are non provided stubs are written. A stub is a faculty shell called by upper degree faculty and that when reached decently will return a message to the naming faculty bespeaking that proper interaction occurred. No effort is made to verify the rightness of the

Leave a Reply

Your email address will not be published. Required fields are marked *