I just have a few questions about best practice in relation to my new delete button code.
I am auto-generating some server code to handle the call from the client to calculate the number of references for a particular row (ie to actually use the methods that Christian is auto-generating.) I will be creating one file in each module that has delete functionality - at the moment this means MCommon, MFinance and MPartner but there will be more as we add more delete buttons. My file names are (for example) Partner.ReferenceCount-generated.cs.
So here are my questions....
I have created these files in the relevant "\Module\connect" folder. Thus I have created
csharp\ICT\Petra\Server\lib\MCommon\connect\Common.ReferenceCount-generated.cs
csharp\ICT\Petra\Server\lib\MFinance\connect\Finance.ReferenceCount-generated.cs
csharp\ICT\Petra\Server\lib\MPartner\connect\Partner.ReferenceCount-generated.cs
Are you happy with these new files being in these locations?? I did it because every module has a 'connect' sub-folder whereas not every one has a 'web' subfolder, for example, so there is no need for any smart mapping between module name and sub-folder name. In most cases the other files in the connect folder are the auto-generated instantiators.
Next question: I have chosen as the namespace for my new files
namespace Ict.Petra.Server.MCommon.ReferenceCount.WebConnectors
namespace Ict.Petra.Server.MFinance.ReferenceCount.WebConnectors
namespace Ict.Petra.Server.MPartner.ReferenceCount.WebConnectors
It has to be a namespace that ends with 'Connectors', but sometimes we use UIConnectors and sometimes WebConnectors. Is there a correct namespace name in this case?? I can easily change it to UIConnectors, if that is the correct philosophy.
As a related issue my class names are like 'TPartnerReferenceCountWebConnector'.
Next question....
For my two methods inside the class that return the reference usage I have assigned the RequireModulePermission attribute as NONE. Do you think that is ok? I justify that on the basis that the only caller for this method is a client screen for which authentication has already been given, but that could be a rather weak justification! I could easily add PTNRUSER for partner but if we need FINANCE permission you will need to explain to me whether that would be -1, -2 and -3 or what??
Final question....
I have coded my auto-generation code into GenerateGlue. It goes as the first task that GenerateGlue does - before it creates any interfaces (because of course I need interfaces creating from these new files). It could equally go in GenerateORM as the last thing that that application does. I chose not to do that because 1) Christian was working on GenerateORM and 2) after adding a new delete button to a screen (YAML file) it is necessary to run this code as well as the usual generateWinForm, so it is slightly less work to edit YAML and run generateGlue rather than generateORM AND generateGlue. But if you would prefer the new code in generateORM I can do that. I can see arguments both ways. (Note: having run generateGlue once after adding a delete button to a YAML file there is no need to do so every time the YAML is edited afterwards).
Thank you for your feedback. The good news is that the current code as-is completely works after a 'clean' and then a build from scratch. I just want to make sure that the new code fits in with your overall design vision.