I’m wondering if this is a stupid question but whatever…
Consider:
this.dataSourceFacade = new DataSourceFacade();
this.SomeGrid.DataSource = this.dataSourceFacade.GetData();
And compare to:
this.SomeGrid.DataSource = new DataSourceFacade().GetData();
Anything wrong with the second approach assuming that’s the only place it gets used?
Richard
Short and simple: No there is nothing wrong with the second approach… in most cases even preferable because cleaner (no unneeded local variables) and better to read+maintain 🙂