Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gyrex-dev] Gyrex Setup worked

Am 03.02.2010 18:03, schrieb Christoph Rueger:
> ".metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.gyrex.preferences.prefs"

> Is this actually customizable? What is this location in a server environment with multiple machines and e.g. a central file-server or database.

Yes. This is fully customizable. Right now it's the "instance" scope.

Eclipse preferences work with different scopes.
http://tinyurl.com/eclipse-preferences-api

The out-of-the box scopes are default, configuration and instance scope.
They match the OSGi locations.

default - set by developer
configuration - "<eclipse>/configuration"
instance - "<workspace>"

In the Eclipse SDK most configuration options are stored per workspace,
i.e. in the instance scope (eg., the installed JDKs, PDE target
platforms, editor settings, etc.). When you start Eclipse, the workspace
chooser dialog remembers the last-recently-used list in the
"configuration" scope, i.e. per Eclipse installation. You can run
multiple instances out of a single installation.

In Gyrex we introduced the "platform" scope. The idea is that we have a
global scope which stores configuration options in a database or LDAP or
shared file-system. Another idea was to store the preferences in the
instance location and just replicate it. Currently, they are stored in
the instance location because that was the simplest implementation.

> Yes, I would definitly try to build a simple sample application. I would prefer something really simple like a Weblog with "Posts" and "Comments". To avoid unnecessary dependencies we could try to avoid a Database and just write to the current user session or something. Just a simple persistence interface but let the HTTP Session be the DB. that way we avoid lots of heavy frameworks like Hibernate etc. I think the goal should be to show people where the important hooks are to build their own application. This sample app should answer the following questions:
>
> * What is the first thing I need to do to build an own app from scratch based on gyrex? 
> * If I have a servlet XYZ, where do I configure (or what glue code do I need to write) it so that I can call it via http://localhost/myapp/myservlet
> * My App wants to use a Logger, what code do I need to write to use Gyrex Logger
> * my app wants to store some properties (configuration data) somewhere. Where is the best place to do this
>
> In the end writing a new app on gyrex should be as easy as Ruby on Rails. *

Great. So let's make it that simple. :)

But how does Ruby on Rails does it? Don't they generate templates for
you out of the box? I imagine we could something similar with PDE
template projects but first we need to spend a little time creating such
a working template.

So, next question ... do you prefer working with Eclipse extension
points or with OSGi services? The former is easier to get started with
because it allows to just start writing the servlet code. The latter
allows more dynamic control but requires writing more code (activator,
dealing with OSGi service, etc.). If you like, we could try both ways.

First step is to create a new plug-in project in any case.

A) "my.app"
B) "my.app.registry"

"my.app" will use OSGi services.
"my.app.registry" will use the extension registry.


-Gunnar

-- 
Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx
http://wagenknecht.org/


Back to the top