Support from Acquia helps fund testing for Drupal Acquia logo

Comments

yas created an issue. See original summary.

yas’s picture

Status: Active » Needs review
FileSize
263.48 KB
yas’s picture

FileSize
391.85 KB
yas’s picture

FileSize
227.54 KB
yas’s picture

Checking-in 8.x-2.x.

yas’s picture

yas’s picture

@baldwinlouie
@xiaohua-guan
@masami

Could you please review the patches?

baldwinlouie’s picture

@yas, Thank you for the patch. Codewise, it looks good. But after reading it, the following came to mind.

I feel like having 'AwsCloud*Service' makes the class name a tad long. Since all the classes are already namspaced in Drupal\aws_cloud\Service\*, I don't feel we need to prepend 'AwsCloud' to the class name.

If we refactor the class names, I feel like we should rather shorten the class names to something like Ec2Service, IamService, PricingService

What are your thoughts?

+++ b/modules/cloud_service_providers/aws_cloud/aws_cloud.services.yml
@@ -1,14 +1,14 @@
-    class: Drupal\aws_cloud\Service\AwsEc2Service
+    class: Drupal\aws_cloud\Service\Ec2\AwsCloudEc2Service
     arguments: ['@entity_type.manager', '@logger.factory', '@config.factory', '@messenger', '@string_translation', '@current_user', '@plugin.manager.cloud_config_plugin', '@plugin.manager.field.field_type', '@entity_field.manager', '@lock']
 
   aws_cloud.iam:
-    class: Drupal\aws_cloud\Service\AwsIamService
+    class: Drupal\aws_cloud\Service\Iam\AwsCloudIamService
     arguments: ['@logger.factory', '@config.factory', '@messenger', '@string_translation', '@plugin.manager.cloud_config_plugin']
 
   aws_cloud.pricing:
-    class: Drupal\aws_cloud\Service\AwsPricingService
+    class: Drupal\aws_cloud\Service\Pricing\AwsCloudPricingService
     arguments: ['@logger.factory', '@config.factory', '@messenger', '@string_translation', '@plugin.manager.cloud_config_plugin', '@http_client']
 
   aws_cloud.subscriber:
@@ -18,15 +18,15 @@ services:

@@ -18,15 +18,15 @@ services:
       - { name: event_subscriber }
 
   aws_cloud.instance_type_price_data_provider:
-    class: Drupal\aws_cloud\Service\InstanceTypePriceDataProvider
+    class: Drupal\aws_cloud\Service\Pricing\AwsCloudInstanceTypePriceDataProvider
     arguments: ['@aws_cloud.pricing', '@string_translation']
 
   aws_cloud.instance_type_price_table_renderer:
-    class: Drupal\aws_cloud\Service\InstanceTypePriceTableRenderer
+    class: Drupal\aws_cloud\Service\Pricing\AwsCloudInstanceTypePriceTableRenderer
     arguments: ['@request_stack', '@aws_cloud.instance_type_price_data_provider']
 
   aws_cloud.google_spreadsheet:
-    class: Drupal\aws_cloud\Service\GoogleSpreadsheetService
+    class: Drupal\aws_cloud\Service\Pricing\AwsCloudGoogleSpreadsheetService
     arguments: ['@messenger', '@config.factory', '@aws_cloud.instance_type_price_data_provider', '@string_translation']
yas’s picture

@baldwinlouie

Thank you for your review. I agreed and liked your idea. I re-created patches.

yas’s picture

Updated 8.x-2.x.

baldwinlouie’s picture

@yas, thank you for the patch and update. it looks good to me.

yas’s picture

@baldwinlouie

Thank you for your review.

@xiaohua-guan
@masami

What do you think?

Xiaohua Guan’s picture

@yas

It looks good to me.

yas’s picture

Status: Needs review » Reviewed & tested by the community

@xiaohua-guan

Thank you for your review. Then, I'll merge the patch to 8.x-1.x and 8.x-2.x and close this issue as Fixed.

  • yas committed 03c6e54 on 8.x-1.x
    Issue #3083121 by yas, baldwinlouie, Xiaohua Guan: Refactor the...

  • yas committed 38e44b3 on 8.x-2.x
    Issue #3083121 by yas, baldwinlouie, Xiaohua Guan: Refactor the...
yas’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.