A typical Import Class

Posted on 2012-09-01
Last Modified: 2012-09-02
I would like to create an Import Object that is able to import data from different types of files.

What are the typical Properties and Methods (attributes and operations) that would make-up such an object? This is a web application.
Question by:IntelligentResponse
    LVL 14

    Accepted Solution

    It really depends on what you want to use the files for, but I'd recommend at least the following:
    File Name
    File Extension
    Mime Type
    File Content
    LVL 14

    Assisted Solution

    Forgot the second part of the question. For methods, you'll want to have at least the following:
    New / Constructor
    Read File / Import
    Write File / Save

    You may also want a Display method that spits out any HTML needed for the file contents to be displayed properly. Such as changing tags to <strong>, etc.

    Author Comment

    Thanks, this looks good. What do you mean by "New / Constructor"?
    LVL 14

    Expert Comment

    Whenever you create a variable as a new ImportClass you'll have to use a constructor method. In VB it's typically called New(). My C# is rusty enough and my brain tired enough that I can't remember if New() is the convention C# uses. Basically you can set any of the private variables you need there. Let me know if you need more help. My brain is pretty shot right now.

    Author Comment

    Not a problem, but I am very familiar with the Constructor and instantiation of an object, was not sure why you had it in the list. I see now why you included it, thanks.

    Author Closing Comment

    Thanks for a direct answer to my question, appreciate it.

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
    The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
    The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
    An overview on how to enroll an hourly employee into the employee database and how to give them access into the clock in terminal.

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now