Title: Persistent Store Engine and Graphical Interface
1Persistent Store Engine and Graphical Interface
- SE690 Project by Edward Babayan
2JOPSE
- What is it?
- Its features
- JOPSE vs. RDMS
- JOPSE vs. Object Relational Database
- Design Characteristics
- Architecture details
- Swing Components vs. AWT Components
- My Mission!
3JOPSE
- Stores data as objects in persistent way
- Easy to learn and user
- Platform independent
- Graphical implementation based on Java Object
Store technology (originally developed by Dr.
Jia)
4Java Object Store
- Console tool object database
- Used for persistent storage of objects
- Designed to be used with Java
- Completely implemented in Java
5JOPSE vs. RDMS?
- Stored Data Object Sets (special kind of
objects) vs. Tables - Data Records Elements (in the Object Set) vs.
Rows of records in a table - Queries Can be based on the values of fields or
the results of method invocations of the objects
in an Object Set. - Element Object Structure consists of fields and
methods. May be of different types. Its
polymorphic.
6Another Databases comparison
- JOPSE vs. Object Relational Database
- Objects stored as Pure Java Objects vs. Blobs
- (binary large objects)
- JOPSE vs. SQLJ
- Pure Java Implementation vs. SQL embedded in
Java. (To use pure java for SQLJ, we need
preprocessor to convert SQLJ to pure Java
programs)
7Design Characteristics
- Simplicity easy to learn and use. The
persistent layer provided by the JOS database
component is nearly transparent to the
programmer. - Objects Sets extensions of the regular Java
collections and sets. - Lightweight small in size, efficient. The
Runtime Jar file of Object Store component is
only 55 KBs. - Extensibility - support a variety of
interchangeable implementations of the database,
storage and indexing policies.
8Architecture behind the Seen
- JOS component stores all database files in
specified directory. - Objects to be stored in JOS component must be
serializable implementing java.io.Serializable
interface. - Example
- public class User implements java.io.Serializable
- public User ()
- // Default contractor
-
- //Methods follow
- //Fields follow
-
9Architecture behind the Seen
- Some current functionality
- To store an object in the Object Store, we could
use one of the following methods - public void bind (Object object, String name)
- Creates new binding
- public void rebind (Object object, String name)
- Replaces current binding with the new one
10Architecture behind the Seen
- ObjectStoreManager class
- main class responsible for Opening object stores
for - read and write. If the object store does not
exist a new - one will be created and returned. Objects can be
- stored in the Object Store or in the Object Set.
- import xj.ostore.
- Â public class AddObjectUsers
- public static void main(String args)
- try
- ObjectStore odb ObjectStoreManager.open
(db1, ObjectStore.OPEN_READWRITE) - Â ObjectSet users odb.createObjectSet
(users) - Users.add (new User (user01, pw01,
Jack)) -
- odb.bind (new User (user01, pw01,
Jack), u1) - odb.bind (new User (user02, pw02,
Jill), u2) - odb.bind (new Student (Jack, 123450001,
3.6f), s1) - odb.bind (new Student (Jill, 123450002,
3.6f), s2) - odb.close()
- catch (ObjectStoreException e)
11Architecture behind the Seen
12Architecture behind the Seen
- Key Features of Object Store
- Storing/Retrieving Objects
- Creating Object sets
- Indexing and Selecting
- Query Predicates
- Updating Named Objects/ Updating Elements in the
Object Set - Removing Names Objects/ Removing Elements in the
Object Set - Deleting Object Store
13Graphical Interface
- Graphical User Interface Modeling
- Goal is to create interactive GUI
- Simple and Powerful Interface several iterations
are necessary! - Component Abstraction and Reuse
- Usage of object oriented GUI components,
encapsulated components called Visuals can be
used. - Visuals can easily be customized to fulfill
particular needs. - Maintenance Aspect
- More structured design results in enhancement of
maintainability. - Any change, enhancement or redesign of general
use can be performed in the base visual class.
14Swing Components vs. AWT Components
- Swing
- Part of JFC which encompass a group of features
to help people build graphical user interfaces
(GUIs) - Code name of the project that developed new GUI
components - First available as an Add-on to JDK1.1
- Java 2 strongly encourages to use Swing
components - Swing components start with letter J
- Swing components are in the package javax.swing
where is AWT components are in java.awt.
15Swing Components vs. AWT Components
- As a rule, programs should not use "heavyweight"
AWT components alongside Swing components.
Heavyweight components include all the
ready-to-use AWT components, such as Menu and
Scroll Pane, and all components that inherit from
the AWT Canvas and Panel classes. When Swing
components (and all other "lightweight"
components) overlap with heavyweight components,
the heavyweight component is always painted on
top.
16Swing Components vs. AWT Components
- What are JFC and Swing?
- The Swing components
- Include everything from buttons to split panes to
tables - Plug gable Look and Feel Support
- Gives any program that uses Swing components a
choice of looks and feels. For example, the same
program can use either the Java TM look and feel
or the Windows look and feel. - Java 2D API
- Easily incorporates high-quality 2D graphics,
text, and images in applications and applets. - Drag and Drop Support
- the ability to drag and drop between a Java
application and a native application
17Swing Components vs. AWT Components
- Swing components implemented with absolutely no
native code. - Swing components can be shipped as an Add on to
JDK1.1, in addition to being part of Java 2
platform - Swing lets you specify which look and feel your
program's GUI uses. By contrast, AWT components
always have the look and feel of the native
platform
18Swing Components vs. AWT Components
- What Swing packages can I use?
- Swing API is powerful, flexible and immense.
- Version 1.1 of the API has 15 public packages
- javax.swing.event, javax.swing.filechooser,
javax.swing.accessibility, javax.swing,
javax.swing.border, javax.swing.colorchooser,
javax.swing.plaf, javax.swing.plaf.basic,
javax.swing.plaf.metal, javax.swing.plaf.multi,
javax.swing.table, javax.swing.text,
javax.swing.text.html, javax.swing.tree, and
javax.swing.undo.
19Swing Components vs. AWT Components
- Swing buttons and labels can display images
instead of, or in addition to, text. - Can easily add or change the borders drawn around
most Swing components. For example, it's easy to
put a box around the outside of a container or
label. - You can easily change the behavior or appearance
of a Swing component by either invoking methods
on it or creating a subclass of it. - Swing components don't have to be rectangular.
Buttons, for example, can be round. - Assistative technologies such as screen readers
can easily get information from Swing components.
For example, a tool can easily get the text
that's displayed on a button or label.
20Swing Components vs. AWT Components
- Be aware of a few got Chas when using Swing
components and AWT - Programs should not, as a rule, use "heavyweight"
components alongside Swing components.
Heavyweight components include all the
ready-to-use AWT components (such as Menu and
Scroll Pane) and all components that inherit from
the AWT Canvas and Panel classes. This
restriction exists because when Swing components
(and all other "lightweight" components) overlap
with heavyweight components, the heavyweight
component is always painted on top. - Swing components aren't thread safe. If you
modify a visible Swing component -- invoking its
set Text method, for example -- from anywhere but
an event handler, then you need to take special
steps to make the modification execute on the
event-dispatching thread. - The containment hierarchy for any window or
applet that contains Swing components must have a
Swing top-level container at the root of the
hierarchy. For example, a main window should be
implemented as a JFrame instance rather than as a
Frame instance. - You don't add components directly to a top-level
container such as a JFrame. Instead, you add
components to a container (called the content
pane) that is itself contained by the JFrame.
21Swing Component Hierarchy
22JOPSE
- My Mission
- Come up with ideal Graphical Interface for
current and future development and use, using
Swing package - Implement some of the current functionality to
automate the process of creating Object Stores,
and storing, retrieving objects as well as their
manipulation through the use of GUI components. - Minimize the process of using command line tools
currently available for testing of the framework.
23Java Object Persistent Storage Engine