Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BeforeRefactoringConstants {
- //HOTEL; CAR; ETC
- constant: SCREEN_NAME = "SCREEN_NAME"
- }
- ///current approach - is feature driven
- class HOTEL {
- constant: SCREEN_NAME = "SCREEN_NAME"
- }
- class Car {
- constant: SCREEN_NAME = "SCREEN_NAME"
- }
- // Reusage of constants
- class AnalyticsLibraryCore {
- constant: SCREEN_NAME = "SCREEN_NAME"
- constant: OTHER_GENERAL_PARAM = "OTHER_GENERAL_PARAM"
- }
- class HOTEL {
- constant: SCREEN_NAME = AnalyticsLibraryCore.SCREEN_NAME
- constant: OTHER_GENERAL_PARAM = AnalyticsLibraryCore.OTHER_GENERAL_PARAM
- CORE = AnalyticsLibraryCore
- }
- class Car {
- constant: SCREEN_NAME = AnalyticsLibraryCore.SCREEN_NAME
- }
- ///Hotel example
- GoogleAnalytics("EventName") {
- parameter {
- HOTEL.SCREEN_NAME = "123"
- HOTEL.CORE.OTHER_GENERAL_PARAM = "456"
- Hotel.Parameter.Name.Param1
- HOTEL.PARAMETER.NAME.PARAM1
- // HOTEL.OTHER_GENERAL_PARAM = "456"
- // AnalyticsLibraryCore.OTHER_GENERAL_PARAM = "456"
- }
- }
- /////////
- class AnalyticsLibraryCore {
- EventName {
- constant: EVENT1 = "EVENT1"
- }
- Parameter {
- Name {
- }
- Value {
- }
- }
- ParameterName {
- constant: SCREEN_NAME = "SCREEN_NAME"
- constant: OTHER_GENERAL_PARAM = "OTHER_GENERAL_PARAM"
- }
- ParameterValue {
- const1 = "234234"
- // Screens {
- // screen1 = "sdddd"
- // }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement