Discussion
· Nov 29, 2021

Naming Convention on ObjectScript Packages, Classes and Package Manager Modules names

Hi, Community!

Open Exchange (OEX) is getting more and more popular and more and more developers consider publishing their apps in the public package manager registry.

This is really great!

So the topic of thoughtful naming convention is getting more important and even critical.  Let's discuss?

There is no need to reinvent the wheel actually - there are proven approaches in resources and packages naming. The most common approach suggests the following.

Let's take ObjectScript classes naming - it consists of packages and classes.

Package1 could be the name of the developer or organization.

Package2 could have the name of the library.

And the class name itself describes the functionality.

So if I develop the class that implements linear algebra functions the name can look as follows:

class Shvarov.Math.LinearAlgebra {}

or for the developer community the class that helps with posts analytics could be:

class Dc.Posts.Analytics {}

Right?

Yes, and no. Yes for naming, and No for letters register. The register for packages should be lowercase, lowercase(!), lowercase!.

I repeated it 3 times to emphasize the importance of the question. 

Indeed, if we refer how files are depicted on disc it will live in /Shvarov/Math/LinearAlgebra.cls and /Dc/Posts/Analytics.cls.

And the issue here is in folders names, that are case-sensitive on Linux systems, and not in Windows. And the problem appears if I having /Dc/Posts/Analytics.cls imported in the system I'll not be able to install the package that has dc.posts.Text class, as there will be different folders on the disc.

So to simplify life for everyone let's consider the lowercase for all the packages' names, and thus proper names could be:

class shvarov.math.LinearAlgebra {}

and 

class dc.posts.Analytics {}

Great!

What about package names for the ZPM package manager?

I suggest a similar approach: organization-library. So for these two classes packages could be:

shvarov-math.ZPM

and 

dc-posts.ZPM

Share your thoughts, please?

Discussion (6)2
Log in or sign up to continue

Hi Robert!

top-level dc came from this discussion. Community people decided on dc. for "community" organisation.

That means they either donate the code to the community or decide to stay anonymous or don't take the responsibility?

But nevertheless dc. is a very popular package...

I think dc. should belong to code samples, templates originated by community moderators? We can discuss again