- Game Development Patterns and Best Practices
- John P. Doran Matt Casanova
- 300字
- 2021-07-02 23:43:40
Understanding UML class diagrams
Software developers have their own form of blueprints as well, but they look different from what you may be used to. In order to create them, developers use a format called Unified Markup Language, or UML for short. This simple diagramming style was primarily created by Jim Rumbaugh, Grady Booch, and Ivar Jacobson and has become a standard in software development due to the fact that it works with any programming language. We will be using them when we need to display details or concepts to you via diagrams.
Design patterns are usually best explained through the use of class diagrams, as you're able to give a demonstration of the idea while remaining abstracted. Let's consider the following class:
class Enemy
{
public:
void GetHealth(void) const;
void SetHealth(int);
private:
int currentHealth;
int maxHealth;
};
Converted to UML, it would look something like this:

Basic UML diagrams consist of three boxes that represent classes and the data that they contain. The top box is the name of the class. Going down, you'll see the properties or variables the class will have (also referred to as the data members) and then in the bottom box you'll see the functions that it will have. A plus symbol (+) to the left of the property means that it is going to be public, while a minus symbol (-) means it'll be private. For functions, you'll see that whatever is to the right of the colon symbol (:) is the return type of the function. It can also include parentheses, which will show the input parameters for the functions. Some functions don't need them, so we don't need to place them. Also, note in this case I did add void as the return type for both functions, but that is optional.
- Learning LibGDX Game Development(Second Edition)
- 流量的秘密:Google Analytics網站分析與優化技巧(第2版)
- 簡單高效LATEX
- Android 7編程入門經典:使用Android Studio 2(第4版)
- Mastering Scientific Computing with R
- 實戰低代碼
- Getting Started with SQL Server 2012 Cube Development
- Asynchronous Android Programming(Second Edition)
- Java實戰(第2版)
- Terraform:多云、混合云環境下實現基礎設施即代碼(第2版)
- Windows Embedded CE 6.0程序設計實戰
- Mastering Adobe Captivate 7
- PyQt編程快速上手
- Solr權威指南(下卷)
- MongoDB Cookbook