Professional Documents
Culture Documents
Table of contents
Table of contents ....................................................................................................................................................2 1. 2. 3. Introduction ....................................................................................................................................................3 Scope ...............................................................................................................................................................3 User level use cases ........................................................................................................................................4 3.1. 3.2. 3.3. 3.4. 3.5. 3.6. 4. Show info use case .............................................................................................................................4 enter/modify data use case ...............................................................................................................5 Add client use case .............................................................................................................................6 Update client use case .......................................................................................................................6 Delete client use case .........................................................................................................................7 Fill database use case .........................................................................................................................7
Implementation details ...................................................................................................................................8 4.1. 4.2. 4.3. 4.3.1. 4.3.2. 4.4. 4.5. 4.6. Introduction ........................................................................................................................................... 8 System architecture ...............................................................................................................................8 System level use cases ...........................................................................................................................9 Show info use case .........................................................................................................................9 enter/modify data use case ...........................................................................................................9 Class diagram .......................................................................................................................................10 Database structure ..............................................................................................................................10 User interface ......................................................................................................................................11
5.
Test plan ........................................................................................................................................................12 5.1. 5.2. 5.3. Unit tests ............................................................................................................................................. 12 Integration tests ..................................................................................................................................12 Functional tests ...................................................................................................................................12
6.
Final thoughts ...............................................................................................................................................12 6.1. 6.2. 6.3. Performance aspects ...........................................................................................................................12 Security concerns ................................................................................................................................13 Functional enhancements ...................................................................................................................13
1. Introduction
SCM is a simple demo system, with the declared intent of showing off our system analysis and software development capabilities. High level requirements are specified in the HLR.pdf document, provided by the client.
2. Scope
SCM will provide, trough a simple WEB page, a table filled with the information available for each client in the database. No pagination or filtering should be implemented. Basic actions should be available to the user: add, edit and delete client. The fields needed for the add and edit actions should be presented to the user on the same page, without reloading (AJAX). All actions should be available with no restrictions to all users (no authentication required). We assume that the users browser has Javascript enabled and is Ajax aware. No fallback methods are provided in case those requirements arent met. Also, no performance constraints are enforced.
Show info
add client
uses
enter/modify data
delete client
Use case narratives are provided in the following chapters. For the most important use cases an activity diagram is included.
The system queries the database and return the client list
[new client]
The user selects a company from the "company drop-down The user selects the year, month and day
[Yes] User clicked on "Reset" [No] [No] All fields are non-empty [Yes] Show error message
Save info in DB
[No]
Reload page
The use case ends when the new page is rendered in the users browser.
4. Implementation details
4.1. Introduction
The proposed implementation uses Java MVC three-tier architecture. This is definitely overkill for such a simple application, but this provides a higher degree of extensibility for future enhancements and a better reusability factor of the existing code base. On the other hand, the purpose of this application is to demonstrate our programming skills, so a more advanced architecture could be appropriate. We will use the following infrastructure components/frameworks: Struts - for implementing the MVC controller Hibernate for database mapping of our domain model DWR for AJAX calls to the business logic YUI for building the Javascript client part
The client part will be valid XHTML code for markup, cross-browser CSS (in a separate file) for layout and positioning and Javascript for actions and gluing together all the required functionality. The client page will render and behave correctly in IE6/7, Mozilla 2.x and Opera 9.x The edit form is implemented as a hidden div (initially) containing all the fields and buttons required.
The CP displays an error message if appropriate or reloads the page if everything was OK on the SP. (Please note the on a production application a more sophisticated approach could be implemented: the SP method returns the new HTML code for the clients table, and the CP replaces the existing table with the received HTML) The use case ends when the new page is rendered in the users browser.
-id : int +name : string +email : string +birth_date : Date +company : Company +accesors for all attributes()
-works for 0..* 1..1 -id : int +name : string +accesors for all attributes()
+updateClient(in id : int, in name : string, in email : string, in birth_date : string, in company : int) +deleteClient(in id : int)
Add client
5. Test plan
5.1. Unit tests
Unit testing will be performed using JUnit on the following classes: DAOHelper AjaxHelper
The functional test should follow closely the all use case scenarios. If the client requires, a full Test scenarios document will be provided, containing test data, step-by-step testing scenarios for each use case and expected results for each test.
6. Final thoughts
Please note that SCM, as defined by this document and implemented in this stage, is a DEMO application. Its not ready to be deployed in a production environment. If one needs to do so, please consider the following aspects:
If further optimization is imposed by high traffic conditions, the Javascript libraries must be evaluated and unnecessary code striped out. Please dont forget to enable adaptive GZIP response compression on the app server. The minimum system requirements are quite low: the theoretically app runs on any modern standardcompliant Servlet container and with any database supported by Hibernate. The system was tested and is certified to run on Tomcat 5.0 with Java 1.5 and MySQL 5.0.
This approach ensures the expected graceful degradation, as Javascript-enabled browsers transparently use scripts/AJAX to perform the tasks and the other ones use plain old page reloading/forwarding mechanism to achieve the same result. Other usability enhancements could be envisaged. For example, a method to close the edit form without saving anything should be provided (now, one needs to either hit the update button or reload the page to get rid of the edit form). Also, the user input validations can be enhanced by imposing format restrictions on the clients name (for example exactly two words with more than 1 character each, space separated, only alpha characters). The current version checks only for non-empty name field. In a production environment and depending on the real usage of the client database, the email address can be checked using an opt-in approach (an email asking for approval is sent to the clients email address and the clients account is validated only when he replies to this message). In present the system checks only for well-formed email addresses. In addition, a supplemental check could be envisaged on the birth date field: the system might restrict users to enter birth dates in the future or in the way to distant past (only clients with a max age of 100, for example). Better error handling and reporting should be implemented. The error messages returned by the application are now quite generic. More useful ones could improve the UI substantially. Also the Javascript alerts can be replaced by a nicer error display (divs right in the page). Another aspect of the UI that must be taken care of is the visual feedback given to the user when AJAX transactions are in progress. Some wait we are working GIFs should appear when such actions take place.