2

Can anyone help me understand what is the Schema, the namespace and consequently the Schema namespace ?

  • 2
    can you provide some examples of where you're seeing these terms? as they can be interpreted differently depending on context it helps alot to have your context – Ralph Callaway Nov 3 '18 at 9:39
3

"Schema", generically, refers to the structure of the database. In Salesforce terms, that means the set of objects you have, the fields on those objects, and the relationships between them. You'll see this usage, for example, in the Schema Builder tool in Setup.

Apex provides a Schema class, which includes top-level methods to get Describe API information about the schema (and associated metadata, like available tabs). The Schema class is in the System namespace.

Apex also has a Schema namespace. The Schema namespace hosts a variety of classes that are used by the Describe API, like DescribeFieldResult. It's also the namespace for static references into Describe metadata, like Schema.sObjectType.Account.

| improve this answer | |
2

Adding on top of what David has already answered.

Schema

By Definition:

Schema is just pictorial representation of relationship between the database created.

In Salesforce, it's a representation of Objects related to each other using relationships as defined when you see it pictorially from Schema Builder

Namespace

By Definition:

A namespace is a one to 15-character alphanumeric identifier that distinguishes your package and its contents from packages of other developers. A namespace is assigned to a package at the time that it’s created, and can’t be changed.

Salesforce has namespaces defined across the platform to group contents as those are offered. E.g.,

Apex classes and interfaces are grouped by the namespaces they’re contained in. For example, the Database class is in the System namespace.

Schema Namespace

By Definition:

The Schema namespace provides classes and methods for schema metadata information.

Based on the above reference of the namespace as utilized in Apex Language Reference, Schema Namespace is a package where it consists of all the classes grouped together which specifically operate on Schema metadata related operations.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.