[WV] WV doesn't know about my database schema..

3 views
Skip to first unread message

Rick Flower

unread,
May 4, 2010, 4:13:38 PM5/4/10
to webve...@googlegroups.com
Ok.. Slowly marching forward.. I noticed now that my
app is listed in the launcher that if I click on the
Database link that it doesn't know that my application
is glorpified -- albeit without ActiveRecord.. Is
there some package property I need to set indicating
what the name of my descriptor system is or something
in order for it to show up in the database page for
my app?

MTIA!!

--
You received this message because you are subscribed to the Google Groups "WebVelocity" group.
To post to this group, send email to webve...@googlegroups.com.
To unsubscribe from this group, send email to webvelocity...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webvelocity?hl=en.

Mark D. Roberts

unread,
May 4, 2010, 8:59:04 PM5/4/10
to webve...@googlegroups.com
Rick,

Could you explain in more detail how "it doesn't know that my application is glorpified"?

When you are in the Application Editor, can you see your descriptor system class on the WebVelocity "Classes" menu?

My understanding is that WebVelocity expects your application to exist in a package. That package also contains a name space that looks like this:

    Smalltalk.Applications defineNameSpace: #MyApplication
        private: false
        imports: '
                private Smalltalk.*
                private Seaside.*
                '
        category: 'WebVelocity'

And thus, your descriptor system classes are expected to look like this:

    Applications.SimpleBlogServer defineClass: #Schema1
        superclass: #{Glorp.ActiveRecords.ActiveRecordDescriptorSystem}
        indexedType: #none
        private: false
        instanceVariableNames: ''
        classInstanceVariableNames: ''
        imports: '
                private Glorp.*
                '
        category: 'WebVelocity'

... or like this:

    Applications.SimpleBlogServer defineClass: #MyDescriptorSystem
        superclass: #{Glorp.DescriptorSystem}
        indexedType: #none
        private: false
        instanceVariableNames: ''
        classInstanceVariableNames: ''
        imports: '
                private Glorp.*
                '
        category: 'WebVelocity'

Does all of that check out? Correct name spaces and superclasses?

HTH,

M. Roberts
Cincom Systems, Inc.

Rick Flower

unread,
May 4, 2010, 9:28:08 PM5/4/10
to webve...@googlegroups.com
On Wed, 05 May 2010 09:59:04 +0900, "Mark D. Roberts"
<mrob...@cincom.com>
wrote:
> Rick,
>
> Could you explain in more detail how "it doesn't know that my
> application is glorpified"?
>
> When you are in the Application Editor, can you see your descriptor
> system class on the WebVelocity "Classes" menu?

Nope.. Actually lots of my classes are missing.. See further comments
below..

> My understanding is that WebVelocity expects your application to exist
> in a package. That package also contains a name space that looks like
this:

My application is in a bundle which consists of 22 packages, only one of
which is registered as an 'application' with the package properties..
I've bundle is packaged by functionality with database stuff in one
package, Admin UI stuff in another, Prelogin processing in one more,etc
Perhaps not the best approach...

This may be why most of my classes are missing from the 'Classes' menu
in WV. Currently WV is only listing the 6 classes that reside in the
one 'main' package that defines the entry point for my application..

> Smalltalk.Applications defineNameSpace: #MyApplication
> private: false
> imports: '
> private Smalltalk.*
> private Seaside.*
> '
> category: 'WebVelocity'

Yup.. Mine is more or less the same but the category is different..
Does that matter?

> And thus, your descriptor system classes are expected to look like this:
>
> Applications.SimpleBlogServer defineClass: #MyDescriptorSystem
> superclass: #{Glorp.DescriptorSystem}
> indexedType: #none
> private: false
> instanceVariableNames: ''
> classInstanceVariableNames: ''
> imports: '
> private Glorp.*
> '
> category: 'WebVelocity'
>
> Does all of that check out? Correct name spaces and superclasses?

Yup.. Got this variation.. However, that's in another package..
which I just added the following package properties to :

library : true
namespace : 'Applications.MyApp'
packageName : 'MyAppDB'

What's the best way to architect an application for maximum 'use'
from within WebVelocity? My current application has almost 100
classes and I'd hate to put them all into a single package.. Sure,
some of them are likely to not need editing on a regular basis
(e.g. my Glorp connection pool class) but most are stuff I'd want
regular access to..

Thanks!

Michael Lucas-Smith

unread,
May 4, 2010, 9:37:33 PM5/4/10
to webve...@googlegroups.com

> What's the best way to architect an application for maximum 'use'
> from within WebVelocity? My current application has almost 100
> classes and I'd hate to put them all into a single package.. Sure,
> some of them are likely to not need editing on a regular basis
> (e.g. my Glorp connection pool class) but most are stuff I'd want
> regular access to..
>
>
It's a very good question. The easiest thing to do is mark all of your
packages as applications. Most web browsers have tabs so you can easily
open up tabs for the two-three packages you're focused on and swap
between them with mouse or hot keys.

One piece of work we had in store for 1.1 that has been delayed to
another release was "whole image browsing" and one of the things that
that might have included would be a quick way to navigate between
applications from the application you're on. Sadly we ran out of time
for this gem and it'll have to wait for another time.

Michael

Rick Flower

unread,
May 4, 2010, 9:57:08 PM5/4/10
to webve...@googlegroups.com
On Tue, 04 May 2010 18:37:33 -0700, Michael Lucas-Smith
<michael.l...@gmail.com> wrote:
>> What's the best way to architect an application for maximum 'use'
>> from within WebVelocity? My current application has almost 100
>> classes and I'd hate to put them all into a single package.. Sure,
>> some of them are likely to not need editing on a regular basis
>> (e.g. my Glorp connection pool class) but most are stuff I'd want
>> regular access to..
>>
>>
> It's a very good question. The easiest thing to do is mark all of your
> packages as applications. Most web browsers have tabs so you can easily
> open up tabs for the two-three packages you're focused on and swap
> between them with mouse or hot keys.
>
> One piece of work we had in store for 1.1 that has been delayed to
> another release was "whole image browsing" and one of the things that
> that might have included would be a quick way to navigate between
> applications from the application you're on. Sadly we ran out of time
> for this gem and it'll have to wait for another time.

Thanks Michael.. Its good to know what a good approach is for
some of the larger apps out there and whether there's a more
optimal way to put them together whether for efficiency or
otherwise.

At your suggestion, I did go ahead and mark my DescriptorSystem
package as an application and it now shows up in the launcher but
is still not connected to the main app.. I might just bite the
bullet and dump them all (or most) of them into a new combined
package.. Luckily I have a fixed class naming scheme I'm using
(with long names) so that should help identify & sort classes
by functionality (e.g. all Glorp or database classes are
prefixed.. Perhaps this is a good thing.. Are there any good
Smallktalk write-ups (whether in a book or otherwise) on
class naming, conventions, etc.. ? In looking over the class
naming of other packages such as Glorp, Seaside, OpenTalk
and others, most seem to not use naming conventions with prefixes
such as what Sport does (e.g. "Sp") or perhaps Seaside with it's
"WA" prefixes for many things.. Is there any preferred
method here that may aid in browsing code, etc?? I think it might
be refactor time!!

Michael Lucas-Smith

unread,
May 4, 2010, 11:35:42 PM5/4/10
to webve...@googlegroups.com
> (with long names) so that should help identify& sort classes
> by functionality (e.g. all Glorp or database classes are
> prefixed.. Perhaps this is a good thing.. Are there any good
> Smallktalk write-ups (whether in a book or otherwise) on
> class naming, conventions, etc.. ? In looking over the class
> naming of other packages such as Glorp, Seaside, OpenTalk
> and others, most seem to not use naming conventions with prefixes
> such as what Sport does (e.g. "Sp") or perhaps Seaside with it's
> "WA" prefixes for many things.. Is there any preferred
> method here that may aid in browsing code, etc?? I think it might
> be refactor time!!
>
Well, prefixes are common in non-VW smalltalks because of the lack of
class namespacing. In VW, we have namespaces to separate them so there
aren't often conflicts with names, so people forgo the prefix. In WV we
create a namespace for the developer immediately to assist in that
venture. We assume one namespace per package, but it's not a hard and
fast rule.

Suffixes are often used to identify "kinds" of things - but in WV the
Classes list groups by "kind" for you. For models they get grouped by
their model name to avoid wasting lots of space - but your existing
application probably doesn't have models in the scaffolding sense, so
this won't help you much.

You can make your own groups by implementing #webvelocityGroupName on
the class side of the superclass you wish to group things by. Perhaps
this can help you organize your classes better.

Cheers,
Michael

Rick Flower

unread,
May 5, 2010, 1:44:43 AM5/5/10
to webve...@googlegroups.com
On Tue, 04 May 2010 20:35:42 -0700, Michael Lucas-Smith
<michael.l...@gmail.com> wrote:

> You can make your own groups by implementing #webvelocityGroupName on
> the class side of the superclass you wish to group things by. Perhaps
> this can help you organize your classes better.

Thanks! I'll give it a try!!
Reply all
Reply to author
Forward
0 new messages