Results 1 to 7 of 7

Thread: Serialization pros and cons

  1. #1
    Hyperactive Member
    Join Date
    Oct 03
    Posts
    436

    Question Serialization pros and cons

    first time ever I did some examples of Serialization.

    I am on the hook to write code that would read an excel file that has five fields.

    Should I use the conventional way to read and write the data from the excel file or Seriable way ?

    are there any disadv and advantages on way over the other?

    thanks
    nath

  2. #2
    Noodly Appendage wossname's Avatar
    Join Date
    Aug 02
    Location
    #!/bin/bash
    Posts
    5,645

    Re: Serialization pros and cons

    What sort of Excel file is it? If its a CSV ten you don't need serialization. If its a normal excel file then serialization won't work unless you do it all manually.
    I don't live here any more.

  3. #3
    Hyperactive Member
    Join Date
    Oct 03
    Posts
    436

    Re: Serialization pros and cons

    what is the advantage of using Serializable way?

    the file is comma separated values file.

    thanks
    nath

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 05
    Location
    Sydney, Australia
    Posts
    80,868

    Re: Serialization pros and cons

    If you're reading a CSV file then you'd simply use a StreamReader or ADO.NET. I don't see an advantage to doing it any other way, although that doesn't mean that there isn't one.

  5. #5
    Hyperactive Member
    Join Date
    Oct 03
    Posts
    436

    Re: Serialization pros and cons

    Jm,

    the reason for my thought of using serialization is, after reading the content of the excel file (which has historical data of a stock), I would like to show that data in a chart (just like they show in yahoo finance).

    does this requirement need the data to be read from CSV file in serialization format?

    thanks
    nath

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 05
    Location
    Sydney, Australia
    Posts
    80,868

    Re: Serialization pros and cons

    The point of serialisation is to convert an object into a form that can easily be sent over a serial connection, hence the name. If you want to create a chart then I don't see how that helps you. What you would want for a chart would be tabular data, so I would think that using ADO.NET to read the CSV into a DataTable would be the most effective in that case. If you prefer there would be less overhead (I think) using a StreamReader and you could still read the data into a DataTable or some other form, like a jagged or multidimensional array or some form of collection. I guess the advantage of ADO.NET is that more is done for you and you have the power of SQL to perform complex queries on the data if desired.

  7. #7
    Fanatic Member
    Join Date
    Jan 05
    Location
    Cebu
    Posts
    605

    Re: Serialization pros and cons

    I have written a stupid ExcelReader class and ExcelRow. You might want to look at it. Also attached is a unit test of my ExcelReader class.
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •