Last modified by chrisby on 2024/03/03 17:01

From version 3.3
edited by chrisby
on 2024/03/03 14:57
Change comment: There is no comment for this version
To version 3.4
edited by chrisby
on 2024/03/03 15:06
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -1,3 +1,10 @@
1 +### Use Cases
2 +
3 +This example is intended to demonstrate the extensibility differences between data structures and objects by extending them with
4 +
5 +1. an Area() function (extending behavior)
6 +1. a rectangle type (extending data type)
7 +
1 1  ### Data Structure Style
2 2  
3 3   type Square struct {
... ... @@ -16,8 +16,10 @@
16 16   return 2 * PI * g.radius
17 17   }
18 18  
19 -*
26 +1.
20 20  
28 +####
29 +
21 21  #### Object-Oriented Style
22 22  
23 23   interface GeometricObject {