Yes, I believe you could do this but why not just go with the feature layer approach shown in the sample? If you use selection mode, as the sample does (against a dynamic map service), it's doesn't bring features to the client until you ask for them (via a click to search).