Advertisement
sanya5791

Untitled

May 20th, 2022
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. class BeforeRefactoringConstants {
  2.  
  3. //HOTEL; CAR; ETC
  4. constant: SCREEN_NAME = "SCREEN_NAME"
  5.  
  6. }
  7.  
  8. ///current approach - is feature driven
  9.  
  10.  
  11. class HOTEL {
  12. constant: SCREEN_NAME = "SCREEN_NAME"
  13. }
  14.  
  15. class Car {
  16. constant: SCREEN_NAME = "SCREEN_NAME"
  17. }
  18.  
  19. // Reusage of constants
  20.  
  21. class AnalyticsLibraryCore {
  22. constant: SCREEN_NAME = "SCREEN_NAME"
  23. constant: OTHER_GENERAL_PARAM = "OTHER_GENERAL_PARAM"
  24.  
  25. }
  26.  
  27. class HOTEL {
  28. constant: SCREEN_NAME = AnalyticsLibraryCore.SCREEN_NAME
  29. constant: OTHER_GENERAL_PARAM = AnalyticsLibraryCore.OTHER_GENERAL_PARAM
  30. CORE = AnalyticsLibraryCore
  31. }
  32.  
  33. class Car {
  34. constant: SCREEN_NAME = AnalyticsLibraryCore.SCREEN_NAME
  35. }
  36.  
  37. ///Hotel example
  38. GoogleAnalytics("EventName") {
  39. parameter {
  40. HOTEL.SCREEN_NAME = "123"
  41. HOTEL.CORE.OTHER_GENERAL_PARAM = "456"
  42.  
  43. Hotel.Parameter.Name.Param1
  44. HOTEL.PARAMETER.NAME.PARAM1
  45.  
  46. // HOTEL.OTHER_GENERAL_PARAM = "456"
  47. // AnalyticsLibraryCore.OTHER_GENERAL_PARAM = "456"
  48. }
  49. }
  50.  
  51.  
  52. /////////
  53. class AnalyticsLibraryCore {
  54.  
  55. EventName {
  56. constant: EVENT1 = "EVENT1"
  57. }
  58.  
  59. Parameter {
  60. Name {
  61.  
  62. }
  63. Value {
  64.  
  65. }
  66. }
  67.  
  68. ParameterName {
  69. constant: SCREEN_NAME = "SCREEN_NAME"
  70. constant: OTHER_GENERAL_PARAM = "OTHER_GENERAL_PARAM"
  71. }
  72.  
  73. ParameterValue {
  74.  
  75. const1 = "234234"
  76.  
  77. // Screens {
  78. // screen1 = "sdddd"
  79. // }
  80. }
  81.  
  82.  
  83. }
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement