Link to home
Start Free TrialLog in
Avatar of Michael Sterling
Michael SterlingFlag for United States of America

asked on

Serialize, then deserialize, vs. deserialize, then serialize: Which order and why?

Working for a new company and I'm learning how they do what they do and why they do it. I've noticed that when setting u the sorting for their grids, they sometimes DE-serialize then serialize, and sometimes they do the opposite. I have done sorting on grids before in C# but have not had to use serialization or DE-serialization so, I'm just trying to get a better understanding of when and why you would want to use this technique? If a brief summary of this can be given that will suffice, otherwise some links on why and why the order matters would be great. Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of it_saige
it_saige
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I don't see why that should have anything to do with sorting.
Neither do I Andy, but you never can tell, what if they sort in the db query rather than in the ui (silly, I know but stranger things have happened)...  ;)

-saige-
Sorting in the DB query itself makes perfect sense.  DB's can index fields and sorting on an indexed field is very efficient (unlike sorting on unindexed fields).  But the DB drivers should take care of the grunt working in making any data available to the app in a suitable format.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Michael Sterling

ASKER

I think I'm gonna close this question as I've gotten some good feedback, and thank you in advance to those who contributed. What I noticed (to your points Kyle & it_saige), is that, in the example that I've been given to model from, they are De-serializing the data into an object, and then, after sorting they serialize and put the same data into a session variable before continuing on to determine which direction to sort the column that has been clicked etc. So, Kyle/it_saige, by your explanation(s) above, they unpacked it into an object first, but then packed it [in]to a session variable which is "sending" the data to a different [storage] location. The utility that pulls the data is from a data access layer which, in this case,  is definitely a separate application domain. Would that be an accurate way to apply your explanation?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks to all who contributed.