uFrame icon indicating copy to clipboard operation
uFrame copied to clipboard

Code Handlers are listed as obsolete but no documented other approach?

Open grofit opened this issue 9 years ago • 4 comments

So historically you either used the action designer (default) or you specified your handler was a Code Handler and just wrote the logic for the handler yourself.

In this version it seems to list Code Handlers as obsolete, however I can find no documentation around what is the new preferred approach for this?

grofit avatar May 14 '16 21:05 grofit

Just override the handler method on the system. There should be a .cs file defining a partial class (for each system) in the system folder for the code created.

jjjuande avatar May 14 '16 22:05 jjjuande

Ok, this still seems a bit nasty compared to the old code handlers, I could be wrong as I only used it briefly but I think they used to be their own files and included via composition into the systems, which seemed far nicer so you could see all the handlers (granted this would mean a file per handler but they are far easier to maintain and explore as multiple files vs one big system.

Assuming it used to create a separate file is there any benefit to not creating code based handlers as isolated classes and using composition to include them at the system level? (I know I could do this manually but then I would have to infer my own pattern for each handler which could be completely different to someone elses so its not as consistent as it could be).

grofit avatar May 15 '16 08:05 grofit

The file is a partial class. You can have every handler on its own file. Whatever you like the most.

jjjuande avatar May 15 '16 09:05 jjjuande

yeah my point is its a bit of digging and a lot of the codegen files live in the same place, also the designer based handlers have their own files, I would personally prefer for consistency to have code handlers in their own files too, but at least I know the current official approach.

grofit avatar May 15 '16 09:05 grofit