In This Article:
🤔 Notice something is missing or not working? → Please contact Zoel (zoelbastianbach@agate.id) on Ms. Teams!
A namespace is simply a collection of classes that are referred to using a chosen prefix on the class name. They are commonly structured as hierarchies to allow reuse of names in different contexts and to enforce modularity.
IAP (in-app purchase) module does not need to be connected with Tutorial module✅ ALWAYS start with "Agate" at the beginning of the namespace, followed by the product name. For example, Agate.Match3
✅ ALWAYS use PascalCase for namespaces
The typical pattern of a namespace is as follow: Agate.[ProductName].[RootModule].[SubModule].[ComponentType]
Agate.Match3.Gameplay.Tutorial.Controller✅ DO separate namespaces based on the module purpose. Treat each feature and functionality as a plugin that's ready to be reused
❓ Why? → To increase the modularity of the project components
❌ INCORRECT example
Agate.Match3.Controller.*** (contain all game controllers in one place)
Agate.Match3.View.*** (contain all game views in one place)
❓ Why is this incorrect? → All of the game files are separated by components, causing the namespace being too vast and not as modular
✅ CORRECT example, separated by modules
Agate.Match3.LevelObjective.Controller
Agate.Match3.LevelObjective.View
Agate.Match3.Tutorial.Controller
Agate.Match3.Tutorial.View
When you want to reuse the Tutorial module, everything is already in one folder and namespace
❌ DO NOT end the namespace just on the module name.
❌ DO NOT use excessive namespaces. Know when to use cluster vs. namespace separation
❌ EXCESSIVE example
Agate.Match3.Scene.Transition.Process.Controller
❓ Why is this excessive? → The namespace become too fine grained thus creating a more complex project structure than it needed to be
✅ CORRECT example
Agate.Match3.SceneTransition.Controller
This namespace still maintain to be modular and clear while not being overly complex