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

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

Summary

Details

Page properties
Content
... ... @@ -1,10 +8,3 @@
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 -
8 8  ### Data Structure Style
9 9  
10 10   type Square struct {
... ... @@ -23,10 +23,8 @@
23 23   return 2 * PI * g.radius
24 24   }
25 25  
26 -1.
19 +*
27 27  
28 -####
29 -
30 30  #### Object-Oriented Style
31 31  
32 32   interface GeometricObject {