The origin of hierarchical structuring

Why are libraries located behind com/ or net/ directory structures?

+7
source share
4 answers

This is an agnostic for Flash, Flex, or any language. It has been used for a long time in general software development. I believe this came from the structure of the Java package , but I'm not sure. It was used because now it is the standard on how to do things and helps to share projects in a rather unique way.

Usually it looks like <domain extension>/<domain>/<project name>/<sub component>/<whatever> .

+11
source

This format / structure is called a reverse domain name structure. This structure is used for the package namespace for your classes.

Here is a good article on Class Track Demystified by Jodi Hall

+3
source

If you are talking about class packages, each item must be unique. Imagine you wrote a class called MyGreatClass . Without any package or in some simple package test.MyGreatClass (this is called the fully test.MyGreatClass name of the class). In this project, you decided to use some library where someone wrote another class test.MyGreatClass (he / she did not understand that you have another). This way you will have a conflict of two classes.

To avoid this situation, there is an agreement to launch classes with the name of the author of the site in the reverse order. Whereas each domain name is unique. By following this convention, you can be sure that your class will not conflict with others.

Since com and net are the most common domains, you can see com.example (for http://example.com/ ) and net.example (for http://example.net/ ) very often.

0
source

Benefits of OOP
Inheritance
maintainability
Repeated usability

A class is considered an object.
The presence of the package structure allows you to use all the advantages of OOP
The presence of a standard "com" folder, where all your custom classes allow you to easily use these classes.

All libraries that I did not create, I am sure, fall into the folder of my com. Therefore, when I create a new project, I just need to specify the project settings in this folder, and then I can access these libraries by simply executing the import statement.

For example, the AS3crypto library that I have in the com folder.

0
source

All Articles