The intent encapsulates the initialization data of the class, controls the changes to the class attributes, and isolates the class data from the methods using the data. Encapsulate class data initialization, control write access to class attributes and separate data from methods that use it. Structure participant MainClass constructs an instance of the DataClass class Based on the constructor parameter list. DataClass encapsulates data. Applicability when the following conditions are met, you can use the Private Class Data mode: Class initialization Data is disposable Data that cannot be modified. You need to control the changes to the class's initialization data. Prevent unnecessary changes to the initialization data. Reduce the attributes exposed by the class. Remove the write permission for data from the class. Implementation Method (1): encapsulate the initialization data. Copy code 1 namespace PrivateClassDataPattern. implementation1 2 {3 public class CircleData 4 {5 public CircleData (double radius, Color color, Point origin) 6 {7 this. radius = radius; 8 this. color = color; 9 this. origin = origin; 10} 11 12 public double Radius {get; private set;} 13 public Color {get; private set;} 14 public Point Origin {get; private set ;} 15} 16 17 public class Circle18 {19 private CircleData _ circleData; 20 21 public Circle (double radius, Color color, Point origin) 22 {23 _ circleData = new CircleData (radius, color, origin); 24} 25 26 public double Circumference27 {28 get {return 2 * Math. PI * _ circleData. radius;} 29} 30 31 public double Diameter32 {33 get {return 2 * _ circleData. radius;} 34} 35 36 public void Draw (Graphics graphics) 37 {38} 39} 40}