Hi, I have a Data Transfer Object which I use to encapsulate values from a search-filter in my application - i.e. the user can filter search-results by project, employee, month, year etc. I am using remoting and passing this as a typed object to ColdFusion.
*The short version of my question*: I want to add a method to my FilterDto, allowing me to reset (some) properties, is it okay to add such a method (will CF simply ignore it), or should DTOs always be devoid of methods. Can adding a method cause problems when remoting? ------------------------------------------ *( ... yes I know I could use binding but...):* When the user presses "Search" I call a method which updates the filterDto with the current values of the filter-components. I didn't want to use binding here, simply for performance reasons, as this is fairly simple, so rather than bind each visual component to the corresponding Dto property I just call a method which updates the properties. Now I have an either-or situation - if the user searches by OrderId I need to clear/reset the other properties, else if they search by any other property they can't also search by a specific OrderId, so I could do with a method (I can't just instantiate a new instance of the DTO as that will clear/reset ALL properties) This functionality feels like it should be a method that belongs in the DTO class. Is it okay to create such methods in DTOs?