What is the difference between class and a table?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi members,
I just started learning about ServiceNow. I am using the ServiceNow learning platform. I am confused as to the difference between a table and a class. Does anyone have a perfect analogy or illustration to aid my understanding of the two?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
"
- In the context of ServiceNow's Configuration Management Database (CMDB), both "table" and "class" are referenced, particularly when using the CI Class Manager. While the document does not provide explicit definitions, it suggests that a "class" refers to a type or category of Configuration Item (CI) with specific attributes and hierarchy, and a "table" is the underlying data structure that stores records for each class. The CI Class Manager is used to manage both tables and class attributes within the CMDB hierarchy."
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hello @alaoemmanuel ,
In short, A table is where records are stored. A class is a definition/type that tells ServiceNow what those records represent and what they inherit.
| Table | Class |
| Stores data/records | Defines the type/category of an object |
| Like an Excel sheet/database table | Like a blueprint/category |
| Contains rows (records) and columns (fields) | Defines properties, fields, and inheritance |
| Used to store actual data | Used to define relationships and common behavior |
| Example: Incident table | Example: Incident class |
| A table can extend another table | A class can inherit from a parent class |
| Example: Task → Incident | Example: Task class → Incident class |
| Think: Where the data is stored | Think: What type of object it is |
If my response helped mark as helpful and accept the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @alaoemmanuel ,
Table = a container for records.
Class = the type of record.
For example:
cmdb_ci→ CI tablecmdb_ci_server→ Server class/tablecmdb_ci_win_server→ Windows Server class/table
So, class tells you what kind of CI it is, while the table is where its data is stored.
-------------------------------------------------------------------------------------------------------------------------------------------
If my response solves your query, please mark it as helpful by selecting accept as Solution and Helpful. Let me know if anything else is required.
Thanks,
Prerna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Think of a table as a storage box and a class as the type or blueprint for what goes in that box. For example, the Incident table stores incident records, while Incident is also a class that extends the Task class and inherits its fields and behavior. Once you understand inheritance, the relationship between tables and classes in ServiceNow becomes much easier to follow.
