Monticello package names, class categories

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Monticello package names, class categories

Frank Shearar
Andreas' latest commit had me looking at my SIP stack for the first time
in a while.

I had named it Network-SIP, because SIP's a network protocol, and I
thought of the naming convention as indicating a nested approach.

It seems that I'm mistaken here though - really, categories are a flat
space, so classes in Network-SIP show up as part of the Network package.

If I now understand correctly then, the mapping between class categories
and packages uses the first token of the category name (so the
characters before the first '-'). Is that right?

If so then I think I should rename my categories from Network-SIP-Foo
to, say, SipStack-Foo, yes? (Like WebClient isn't Network-WWW.)

frank

Reply | Threaded
Open this post in threaded view
|

Re: Monticello package names, class categories

Bert Freudenberg

On 01.09.2010, at 10:23, Frank Shearar wrote:

> Andreas' latest commit had me looking at my SIP stack for the first time in a while.
>
> I had named it Network-SIP, because SIP's a network protocol, and I thought of the naming convention as indicating a nested approach.
>
> It seems that I'm mistaken here though - really, categories are a flat space, so classes in Network-SIP show up as part of the Network package.

Well, only if a Network package exists. And if it does not define a custom PackageInfo. If it did, it could exclude "Network-SIP".

> If I now understand correctly then, the mapping between class categories and packages uses the first token of the category name (so the characters before the first '-'). Is that right?

It's just a convention. Most packages in trunk follow that convention. But e.g. ToolBuilder and HelpBrowser do not.

When using the default package info then it depends solely on the name of the package. It matches a category named exactly like the package, plus all categories beginning with the package name and a hyphen. But the package name itself can well contain a hyphen, too.

See class PackageInfo, it's pretty straight-forward.

A package can include or exclude arbitrary classes and methods though, by subclassing PackageInfo. We don't use that in trunk, but third-party packages can, and occasionally do. Seaside used to do that. A particularly ingenious example is HMM's PackageInfo for OMeta2.

> If so then I think I should rename my categories from Network-SIP-Foo to, say, SipStack-Foo, yes? (Like WebClient isn't Network-WWW.)

Despite what I explained above, yes ;) If you care about sort order, NetworkSIP-Foo would work, too.

- Bert -