chaokunyang commented on code in PR #1313:
URL: https://github.com/apache/incubator-fury/pull/1313#discussion_r1443785892


##########
javascript/packages/fury/lib/gen/router.ts:
##########
@@ -17,28 +17,22 @@
  * under the License.
  */
 
-import { Fury } from "../type";
-import { InternalSerializerType, RefFlags } from "../type";
+import { TypeDescription } from "../description";
+import { SerializerGenerator } from "./serializer";
+import { InternalSerializerType } from "../type";
+import { Builder } from "./builder";
+import { Scope } from "./scope";
 
-export default (fury: Fury) => {
-  const { binaryReader, binaryWriter, referenceResolver } = fury;
-  const { uint8: readUInt8 } = binaryReader;
-  const { int8: writeInt8, uint8: writeUInt8 } = binaryWriter;
-  return {
-    ...referenceResolver.deref(() => {
-      return readUInt8() === 0 ? false : true;
-    }),
-    write: 
referenceResolver.withNotNullableWriter(InternalSerializerType.BOOL, false, (v: 
boolean) => {
-      writeUInt8(v ? 1 : 0);
-    }),
-    writeWithoutType: (v: boolean) => {
-      writeInt8(RefFlags.NotNullValueFlag);
-      writeUInt8(v ? 1 : 0);
-    },
-    config: () => {
-      return {
-        reserve: 4,
-      };
-    },
-  };
-};
+type SerializerGeneratorConstructor = new (description: TypeDescription, 
builder: Builder, scope: Scope) => SerializerGenerator;
+
+export class Register {

Review Comment:
   In java we have a class named as `CodeGenerator`, and has a class named 
`CodecBuilder`. Hope it can give some inspiration



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to