My first advice would be: don't make it too complex. Do absolutely everything you can to avoid this kind of complexity. Then, if there is nothing further you can do to simplify it, the complexity is real and it cannot be simplified significantly.
Don't forget that you can make choices inside the bodies using classes. You can try naming tricks like inheritance to conceal the complexity in different ways, but you can't avoid it. I recommend taking the time to come up with very clear naming, keeping or hiding parameters. The goal is to make your intentions as clear as possible. If your intentions are complex, that is what you have decided. The goal is to avoid unintentional complexity. Mark Nicolas Charles wrote: > Hi, > > As my promises are getting more and more complex, I'm facing an issue > with the body actions. > Let's say I want to log in a file the execution result of a promises, > and I want this promises to be run in background, a not more often than > once per 6 hours., and sometimes I only want to run it as warn_only > > How can I do something like it that would be a bit modular and reusable, > without having a dozens arguments ? > > Regards, > Nicolas > _______________________________________________ > Help-cfengine mailing list > [email protected] > https://cfengine.org/mailman/listinfo/help-cfengine -- Mark Burgess ------------------------------------------------- Professor of Network and System Administration Oslo University College, Norway Personal Web: http://www.iu.hio.no/~mark Office Telf : +47 22453272 ------------------------------------------------- _______________________________________________ Help-cfengine mailing list [email protected] https://cfengine.org/mailman/listinfo/help-cfengine
