# What is recommended way to define my function option

In Mathematica 5.x days many packages used the following standard mechanism to read option values

Options[myfun]={myQuiet->True};

myfun[arg_,opts___?OptionQ]:=Module[{theQuiet},
theQuiet=((myQuiet/.{opts})/.Options[myfun,myQuiet]);
someCode
]


However it does not cover passing values of more complex options like myMethod->{"TensorProduct", myOrdering->1,myStart->someValue}

Sure I can use First/Rest commands to read values of myMethod suboptions, however, I would like to know what is the standard/recommended way to deal with suboptions and how to set their default values.

• Have you seen Dealing with nested options? – jkuczm Feb 5 '16 at 15:05
• Thanks, I didn't seen beforer, however it is not about the same think I want. My wish to learn how for example NDSolve[system, Method -> {"ExplicitRungeKutta", "DifferenceOrder" -> 5, "Coefficients" -> DOPRICoefficients}]; options are passed. – user18792 Feb 8 '16 at 7:32