on 10/17/2000 10:54 AM, "Mike Haberman" <[EMAIL PROTECTED]> wrote:

> 
> Hello,
> 
> I would like to propose a new direction for jyve2.0.  I would
> appreciate your input.  This note's a bit long, but hopefully, it
> makes sense.

Great!

> The solution outlined below actually makes a lot of the complexity
> of the code base go away. And the same template can be used regardless
> of the topology.  Let's start with the new database schema.
> 
> Here's the schema for hierarchal/threaded data segment management (HDSM)
> (If you want one database to keep track of multiple HDSM's, then
> we would need to add one more table):

Right.

> CREATE TABLE DataSegment
> (
> id SERIAL,  // auto increment primary key
> 
> pid          int NOT NULL default 0, //  parent id, 0 is top level

to be consistent make it:

parentID

> value        text NOT NULL,
> 
> statusID     int4 NOT NULL DEFAULT 1,
> visitorId    int4 NOT NULL DEFAULT 1,
> displayOrder int DEFAULT 0,
> 
> deleted    char NOT NULL DEFAULT 'N',
> deletedBy  integer,
> 
> modifiedBy  integer,
> modifedDate timestamp default 'now',
> 
> released     char NOT NULL DEFAULT 'N',
> releasedBy   integer,
> releasedDate timestamp default 'now',
> 
> depth   int2,   // system assigned

"integer"

> // = parent's depth + 1
> // best implemented as a trigger
> // will have a default implementation for
> // dbase's that don't provide that functionality
> 
> PRIMARY KEY (id)
> );
> create unique index answer_idx1 on answer (id, pid);
> create index answer_idx2 on answer (pid);

Looks good. Since you will (I hope) be using the peer system, maybe there is
something in there that you can add that will allow you to simulate the
functionality of the trigger that you need. Above all, the next version of
Jyve has to work with as many databases as possible.

> I removed saveType.   Why not always use html ?  Use <pre> & </pre> for
> plain text.   statusID is an optional fkey into a status table (not shown)

Because I wanted users to be able to just use a popup menu to define this
without having to know any html.

> CREATE TABLE depth;
> (
> id SERIAL,
> 
> label  varchar(80),
> depth  int,

"integer"

> PRIMARY KEY (id)
> );
> 
> The depth table allows for easy selects of the data base.  I figure
> that viewing the information will be done much more than adding/updating.

Sounds good.

> A couple of good things happen now:
> 
> 1.  Moving around items is easy (haven't thought about the GUI side yet)
> all you do is reassign the pid, (the children move with it).  This
> is on the TODO list for jyve.

+1

> 2.  There's only one table to worry about.  That means adding new
> layers is easy and don't require a massive rewrite of the code base.

Totally.

> 3.  There's a whole bunch of code reuse.  No longer do you need
> actions like AddQuestion, AddAnswer, ReleaseX, ReleaseY, etc.
> You have an AddAction, ReleaseAction, DeleteAction, UpdateAction.
> Templates can be reused as well as long as we push in the right
> information into the context.

Sigh...that is some of my ugliest code. :-( It was definitely a weekend
hack. copy/paste was easier and faster than good design. :-)

> 4. Clients can define the data flow how they want to.

+1

> jyve would actually be a specific instance of using the HDSM system:
> 
> Jyve
> depth table:
> PROJECTS  1
> FAQS      2
> TOPICS    3
> QUESTIONS 4
> ANSERS    5

+1

> (note that we could stuff other localization information into
> this table as well)

+1

> The negative side of all this, is that we would have to write a
> utility to reformat the data from the old system to the new system.

I don't think it will be that big of a deal.

> let me know what you think,

+1

-jon

-- 
http://scarab.tigris.org/    | http://noodle.tigris.org/
http://java.apache.org/      | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/       | http://www.sourcexchange.com/


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Archives and Other:  <http://java.apache.org/main/mail.html>
Problems?:           [EMAIL PROTECTED]

Reply via email to