Instead of passing many arguments to a method, I was encapsulating it into an argument object.
note: simplied for demo
For such a case, what would be a better practice?
• Create a class and name it as
InventorySaveArgs
?
-- or --
• Create a nested class and name it asSaveArgs
?
And would you also explain why one would choose one or the other?
[EDIT]: That argument type will be used in another assemblies, as well.
side question: Just curious, if there is a pattern name for encapsulating multiple parameters to a single object by chance.
[UPDATE]: Found Nested Type Usage Guidelines on MSDN
InventorySaveArgs
should be available from another assemblies, so I am going with a regular class.
IIRC .NET Design Guidelines are pretty clear on this - there should be no public nested types.