Comparing the Classification System with the Type System

Objective

After completing this lesson, you will be able to distinguish the benefits of using the classification vs the type system for product attribution, depending on business scenarios.

Best Practices

Once you understand what the type and classification system can do, the big question that remains is: When do you use the type, and when do you use the classification system?

The two are always used together to build a robust product attribute system. But there's no single golden rule for determining how many attributes to define with each method. Instead, there are different factors that you can use to weigh your decision.

Type System Vs. Classification

CriteriaType SystemClassification
Attribute creationHard coded by a developer and needs a platform restartOn the fly by a business user
System performanceLower hardware requirementsHigher hardware requirements
Business logicDesigned to be used in business logicDifficult to include in business logic
FlexibilityAll product items of a type have the defined attributesAttributes flexibly assigned by category

A Practical Example

So far, this all sounds very theoretical. Let’s put it into a more practical context using our car example. Assume Cars R Us has a new generation of cars with a redesigned supercharger. To advertise these cars, a few will be sent to certain dealerships so customers can view and test-drive them.

In PCM Cars R Us needs two new attributes to be added. Dealership location and Supercharger. Should these be handled in the type or classification system?

Supercharger: This attribute applies to all cars of that kind and potentially to many others, as modern cars nearly all have some type of supercharger. This fact is also unlikely to change, as long as people still drive cars with combustion engines. Also, this feature could be useful for some business logic. Price, maintenance schedules, or warranties may be tied to the kind of supercharger.

So, ideally, this feature would be added to the type system, potentially as a parent type higher up the inheritance tree, since most cars will need it.

Dealership location: This isn't necessarily relevant to customers but is more useful for internal tracking of car locations. Also, only a few cars will need this information, so it shouldn’t be added everywhere. Showcars may also change often as new updates roll out or cars become too old to serve as flagship products. So, the classification system would be the better choice here. Changes to specific products can be made quickly, without downtime or extra development costs.

Summary

  • The type system is a more performant method of assigning attributes that assigns attributes to all products derived from a type, including inherited attributes.
  • Attributes defined in types can be used in business logic.
  • Classification attributes can be assigned on the fly by business users and can be assigned flexibly to specific products or categories.
  • The classification system may have an impact on system performance and isn’t designed to be used in business logic.