Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding unused filler fields in Harmony Core generation and request structures. #349

Open
tscaff opened this issue Jul 25, 2023 · 4 comments
Labels
question Further information is requested

Comments

@tscaff
Copy link

tscaff commented Jul 25, 2023

I apologize if this sounds like an odd or kind of simple question, but there are fields on the repository, that when Harmony Core is generated, are showing as part of the request and response Metadata that are passed around on the structures structures.

We were wondering if there is a way to exclude them from the request and response structures to help minimize the payload and wordiness of the requests and responses?

From what I have gathered from conversations around our development group, some folks are creating whole new repository structures which are derivations of the original structure which have limited subsets of fields from the original structures. That seems like that may be creating a bit of extra work that could be avoided. Any thoughts on this?

@tscaff tscaff added the question Further information is requested label Jul 25, 2023
@SteveIves
Copy link
Contributor

Hi Tom,

If you want to exclude specific fields, always, you can do so by adding the text HARMONY_EXCLUDE to the field's long description.

CodeGen also has a feature called field subsets, which allows you to define subsets of fields to be processed. Subsets can be defined in two ways, either in the repository, by adding text to the fields long description, like this:

@SUB=SUBSET1
@SUB=SUBSET2

And then referencing the subset in your codegen command:

codegen -s STRUCT1 -subset SUBSET1 ...
(CodeGenTask.Subset property (String))

Or entirely on the command line:

codegen -s STRUCT1 -fields FIELD1 FIELD2 FIELD3 ...
(CodeGenTask.SubsetFields property (List<Tuple<String, String>>))

I have never done this when creating Harmony Core data objects, but in theory, it should work, so long as you use a structure alias to alter the name of the class that is created and don't exclude any fields that are used as key segments.

@tscaff
Copy link
Author

tscaff commented Jul 25, 2023

You are pure gold @SteveIves! Thank you so much. That's what I was looking for.

@SteveIves
Copy link
Contributor

Actually, thinking about it some more, while @HARMONY_EXCLUDE will work to exclude specific fields, the whole field subset thing won't work for you in the Traditional Bridge world if you are using code generation driven off a Synergy method catalog. The problem you will hit is that while you can manipulate codegen to produce data objects all based off a repository structure but with different names and properties, you won't have an actual repository structure to name in parameter definitions in the SMC.

If you're not using the SMC and related code generation then you could make it work for sure, but then you'd have to manually code a lot of additional stuff, including dispatcher classes on the traditional side, and controller, service and request/response classes on the .NET side.

I can see this being a popular feature if we can make it work, but a solution is not currently obvious.

@tscaff
Copy link
Author

tscaff commented Jul 25, 2023

No problem. I think specific field exclusion is all we need to do at the moment. But that is an interesting concept you mentioned, and yes that could be a nice feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants