This is generally considered a clean and helpful way to manage code. If I have a Book
object anywhere in my codebase, I can trust it will have the same interface, without me having to scatter or duplicate code everywhere. If I want to change how it does something, I can change the implementation inside the class and trust that change will be reflected everywhere it’s used.
The parallels to content management should be very clear –
- A content type is a Class
- A content object is an Object
- An attribute is a Property
Thus, it’s very helpful if content objects can be automatically translated into code objects when they’re retrieved. In your programming code, you can have a Book
class with a property for Title
and know it will automatically retrieve the correct attribute value.
This is called strong typing, which means there’s a parallel between the content type and a class in the programming language, and the CMS will handle the translation automatically.
Some systems don’t strongly type content objects, and they are all represented as a generic, catch-all class – so-called weak typing – when developers need to work with them.
Instead of Book
, the class might be called something like ContentObject
or Item
. Instead of reading named properties on the object like Title
, there is some generic method for accessing attributes, like GetAttribute("Title")
.
This is not a major problem, it just means more work for the developer, and a slightly increased chance of error if there’s an invalid attribute value.