Mai 17, 2009 by netseeker in
Sonstiges
For my current project i decided to use ActiveObjects as ORM layer. Additionally i looked for a free, java based database engine which offers support for
- Embedded Mode
- Full Text Search
- Blobs and Clobs
Finally i decided to use the H2 database. Unfortunately i was lazy and didn’t check ActiveObjects list of supported databases.
ActiveObjects doesn’t support the H2 database out of the box.
Using ActiveObjects HSQLDatabaseProvider (H2 is known to be highly compatible with HSQL) doesn’t work because in ActiveObjects a DataBaseProvider has to return the appropriate JDBC driver class.
To use the HSQLDatabaseProvider for H2 anyway you can just extend it and overwrite the getDriverClass() method:
package net.java.ao.db;
import java.sql.Driver;
/**
* @author netseeker
*
*/
public class H2DatabaseProvider extends HSQLDatabaseProvider {
/**
* @param uri
* @param username
* @param password
*/
public H2DatabaseProvider(String uri, String username, String password) {
super(uri, username, password);
}
/*
* (non-Javadoc)
*
* @see net.java.ao.db.HSQLDatabaseProvider#getDriverClass()
*/
@SuppressWarnings("unchecked")
@Override
public Class< ? extends Driver> getDriverClass()
throws ClassNotFoundException {
return (Class< ? extends Driver>) Class.forName("org.h2.Driver");
}
}
The new DataBaseProvider can then be used like this:
EntityManager manager = new EntityManager(new H2DatabaseProvider(
dbProperties.getProperty("db.uri"),
dbProperties.getProperty("db.username"),
dbProperties.getProperty("db.password")));
Oktober 30, 2008 by netseeker in
Development
Gefunden bei CLOSED-LOOP: Certification to become braindead?.
War ja klar: Swing ist einfach langsam. Nein, noch besser Swing ist langsamer als ein Stack bestehend aus JSP, EJB3 Entity Beans und Stateless Session Beans.
…Zumindest scheint das die Meinung des Sun Learning Centers zu sein. Will man bei denen nämlich den Sun Certfied Enterprise Architect (SCEA) bekommen, sollte man folgende Frage besser nicht nach besten Wissen und Gewissen bzw. mit logischem Sachverstand beantworten:
You are architecting a real-time system with high usage and high volumes of transactions. You need an MVC application with quick presentation times resembling a thin client and will have several pre-populated views that can carry across several pages. The users must be able to quickly navigate between different sections of the system.
Which three technologies will you need to implement? (Choose three.)
- A) MDB
- B) Swing GUI controls
- C) JSP
- D) EJB3 Entities
- E) Stateless Session Beans
- F) JCE
Die Lösung:
- C, D und E sind richtig
- A ist falsch, weil es sich um ein Real-Time-System handelt und MDBs asynchron sind.
- B ist falsch, weil Swing-Komponenten notorisch langsam sind. (im Original: Option B is incorrect because swing components are notoriously slow).
- F ist falsch, weil die Beschreibung keine Anforderungen an die Sicherheit stellt
Na aber klar doch. Swing-Komponenten sind langsamer wie so ein bisschen Network-Traffic, der Servlet-Container, die JSP-Engine sowie schlußendlich etwas HTML und Javascript im Browser.
Manchmal könnte man meinen glatt den Beruf verfehlt zu haben. Den SCEA würde ich wohl nie bekommen…
Oktober 22, 2008 by netseeker in
Development,
Swing
…oder wo finde ich Infos über Usability und Accessibility in Webanwendungen.
Grundsätzlich weiß es ja jeder Entwickler: Oberflächen sollte jemand entwerfen, der sich damit auskennt und auf Usability und Accessibility achtet. Leider ist dieser Jemand nie da, wenn man ihn braucht bzw. verzichten die meisten Firmen auf eine Stelle für einen solchen Jemand. Die Folge ist meistens ein Oberflächendesign vom Entwickler, sozusagen ala “A Users Nightmare”
Manchmal wird es zwar nicht ganz so schlimm aber gut wird es eben auch nie und nimmer.
Damit es nicht vollständig daneben geht, wenn bei euch die nächste Webanwendung ansteht und der Jemand wieder mal nicht verfügbar ist:
Juni 23, 2008 by netseeker in
Software