I never really completely understood what a package is.
Are they just a class-hierarchy that solves a specific problem?
What is the difference between a package and a specific framework?
Are there naming conventions for packages?
When and where do you use @package phpdoc?
PEAR uses packages, is a PEAR package any different from a normal package?
Is a package exclusive to PHP?
Does a package only feature source code?
As you can see I'm rather confused.
What is a Package?
Moderator: General Moderators
- Ollie Saunders
- DevNet Master
- Posts: 3179
- Joined: Tue May 24, 2005 6:01 pm
- Location: UK
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US
According to Wikipedia, a package is either a software installation executable (not applicable) or a Java construct that simulates namespaces and groups similar/related classes together.
To me:
properties/methods < classes < packages
Classes can be tightly coupled together, but a package is a fairly opaque supersystem of these classes.

One final note: don't get too hung up on terms. They can mean many different things. Convention is more important.
To me:
properties/methods < classes < packages
Classes can be tightly coupled together, but a package is a fairly opaque supersystem of these classes.
Yes.Are they just a class-hierarchy that solves a specific problem?
A framework defines the architecture of a system. A package just sort of hangs out and says, "Hey, use me!"What is the difference between a package and a specific framework?
PHP doesn't have real namespaces, so I assume Packagename_Classes, although it may be fuzzy.Are there naming conventions for packages?
Never used it.When and where do you use @package phpdoc?
Not really, except that it's really, really, really easy to install, and has well defined dependencies to other packages.PEAR uses packages, is a PEAR package any different from a normal package?
Of course not!Is a package exclusive to PHP?
Nope. As PEAR demonstrates, it can contain documentation too!Does a package only feature source code?
One final note: don't get too hung up on terms. They can mean many different things. Convention is more important.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
I think the traditional meaning of a package is some software accompanied with a title, version number, license and possibly some vendor information. It does not need to be classes, but in some languages with actual Package object (e.g. Java) is ususally means a set of classes. I am sure that PEAR adds it own spin to the meaning. Also Linux package managers like RPM and APT add build and dependency information into the package.
(#10850)