alexeyinkin commented on code in PR #24957:
URL: https://github.com/apache/beam/pull/24957#discussion_r1131967702


##########
playground/frontend/lib/modules/actions/components/new_example_action.dart:
##########
@@ -38,7 +38,9 @@ class NewExampleAction extends StatelessWidget {
         label: 'intents.playground.newExample'.tr(),
         onPressed: () {
           launchUrl(Uri.parse('/'));
-          AnalyticsService.get(context).trackClickNewExample();
+          PlaygroundComponents.analyticsService.sendUnawaited(

Review Comment:
   I also agree that `sendNewExampleEvent` makes more sense. But this sense 
comes at a cost. If `AnalyticsService` has a method per event, then we must 
have a service for Playground, and a service for Tour of Beam because they use 
different events, and a common ancestor for common events.
   
   Multiply this by the abstract `AnalyticsService` and 
`GoogleAnalyticsService`, and you get 6 classes. Then these classes are mostly 
boilerplate because all they do in these methods is repackaging their named 
parameters to specific event objects. And they must do that because we need 
those objects to store `lastEvent` for testing.
   
   This is why we chose a single `sendUnawaited` method.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to