Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cs297:project:design [2008/05/18 01:57] – admin | cs297:project:design [2008/05/18 03:48] (current) – admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Design ====== | ||
+ | This page describes some of the design and organization of the Logic web application, | ||
+ | |||
+ | ===== Java Classes ===== | ||
+ | |||
+ | |||
+ | The Java classes are part of the '' | ||
+ | |||
+ | ==== servlets.LogicListener ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | A '' | ||
+ | |||
+ | For example, LogicListener sets up the pool of connections from the database. | ||
+ | |||
+ | |||
+ | ==== filters.AuthorizationFilter ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | There should be an entry (< | ||
+ | |||
+ | Look through this code to understand what you have to do in the login servlet code, such as creating a " | ||
+ | |||
+ | |||
+ | |||
+ | ==== Model Classes ==== | ||
+ | |||
+ | I created a few classes in edu.wlu.cs.logic, | ||
+ | |||
+ | === LogicData === | ||
+ | |||
+ | The '' | ||
+ | |||
+ | For example, you might want to do something like: | ||
+ | |||
+ | public class LogicData ... | ||
+ | |||
+ | public boolean isAuthorizedUser(String username, String password) { | ||
+ | // DB query ... | ||
+ | | ||
+ | } | ||
+ | |||
+ | public User getUser(String username, String password) { | ||
+ | // assumes authorized user | ||
+ | // use a connection from the pool of connections | ||
+ | User user = new User(username, | ||
+ | | ||
+ | } | ||
+ | |||
+ | } | ||
+ | |||
+ | public class User ... | ||
+ | |||
+ | public User(String username, String password, Connection con ) { | ||
+ | // Populate the user's data from the database | ||
+ | } | ||
+ | |||
+ | public User( String username, String password, String email, ...) { | ||
+ | // another way to create a user object | ||
+ | } | ||
+ | } | ||
+ | |||
+ | Both the LogicData class and the User class make queries on the database, but the Servlets have to go through the LogicData class because that is what is in the ServletContext and LogicData controls the DB connection pool. | ||
+ | |||
+ | ==== Servlets ==== | ||
+ | |||
+ | You may need to cast a session' | ||
+ | |||
+ | ===== Database ===== | ||
+ | |||
+ | The database' | ||
+ | |||
+ | To connect to the database, you will need to change the DB user's name to your name in the appropriate context parameter in the web.xml file. | ||
+ | |||
+ | ===== Orbital API ===== | ||
+ | |||
+ | We are using the [[http:// | ||
+ | |||
+ | ==== Symbol Representation ==== | ||
+ | |||
+ | We need a class that translates between these symbols: | ||
+ | |||
+ | ^ Meaning | ||
+ | | not | & | ||
+ | | and | | & | | ||
+ | | | | <=> | | ||
+ | | or | v | '' |