azure-sdk-for-java icon indicating copy to clipboard operation
azure-sdk-for-java copied to clipboard

Callautomation implementation design feedbacks

Open anuchandy opened this issue 1 year ago • 1 comments

There are two general design review feedback while reviewing azure-communication-callautomation changes (as part of azure-json migration) -

  1. CallAutomationEventParser: The parse method currently compares the eventType string with fully qualified event type name. The fully qualified name always starts with Microsoft.Communication.*. This means the logic may be changed to chrck if the eventType start with this value, if so, extract the last portion and then compare only the last portion. This saves us from repetitive string comparison for the values with same prefix.
  2. The converter types under converter namespace are nothing but custom model classes. The general pattern for such custom model is to keep them under implementation.models namespace and name appropriately.

Another observation I've while working on migrating to azure-json is – many of the public handwritten model types, that act as a custom model, uses serialization annotations while those are never used to create the payload to send over wire. Unless there are any specific reason, its recommended to keep them as plain models, this really ease the maintainability cost of library going forward, reduces the potential bugs and avoid unnecessary contract which we may not be able to implement consistently.

Another observation, the RecordKind in handwritten uses different casing than the one used by generated type RecordKind

anuchandy avatar Jun 27 '24 16:06 anuchandy

Tagging owners to evaluate.

anuchandy avatar Jun 27 '24 16:06 anuchandy