Some good design ideas

  • When updating instance, use the new way, do not modify in place
    when've heard phoenix server, ie the need to update a server, do not change the original instance, but by creating a new instance of the way, so that each instance since been created, does not change, and just need an updated version of, it will be very easy to maintain.

  • Not to generate a plurality of objects in a class, should provide a plurality of classes, each class read the same input, generate different classes
    such advantage is that the logic is divided between classes, will not influence each other, If there is something universal, you can share it. whether it is shared code has been generated or shared objects can

Guess you like

Origin www.cnblogs.com/ctrlzhang/p/11689690.html