Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. What is the best possible Design Pattern

What is the best possible Design Pattern

Scheduled Pinned Locked Moved Design and Architecture
questiondatabasedesignsysadminregex
3 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JoeContreras
    wrote on last edited by
    #1

    Hi, I'm designing a processing engine that will do the following: 1. Determine the file type, i.e .TXT;.CSV;.XML 2. Check to make sure the file being review is valid 3. Make sure the data is valid based on delimiter and based on XML parsing 4. Load to a database server or pass to some type service The purpose of this is to enable IS to utilize this "Framework" and extend the use of File I/O functionality or XML functionality dependending on the file type selected. My first question is where do I start? I'm looking at the Decorator/Iterator patterns but I feel I'm only extending the File I/O. Thanks,:confused:

    N 1 Reply Last reply
    0
    • J JoeContreras

      Hi, I'm designing a processing engine that will do the following: 1. Determine the file type, i.e .TXT;.CSV;.XML 2. Check to make sure the file being review is valid 3. Make sure the data is valid based on delimiter and based on XML parsing 4. Load to a database server or pass to some type service The purpose of this is to enable IS to utilize this "Framework" and extend the use of File I/O functionality or XML functionality dependending on the file type selected. My first question is where do I start? I'm looking at the Decorator/Iterator patterns but I feel I'm only extending the File I/O. Thanks,:confused:

      N Offline
      N Offline
      nitikin
      wrote on last edited by
      #2

      I might have done it this way: Have a class for each file type. 1.) Find out the class/provider which knows how to handle the given file type from the list of registerd handlers (maintained in a global variable list). eg:= FileProcessorTXT, FileProcessorCSV etc, all deriving from FileProcessorBase. 2.) If there is no registered handlers, error! 3.) If there is a registered handler, call the virtual function Validate() which should check the format. eg:- FileProcessorTXT's Validate() needs to bother about TXT file validation only. The above classes job is to validate, read the special file types. Now we might need to introduce a common interface to talk with the DB. This could be a class/function on the FileProcessorBase such that each of the descendants would return data in the accepted format; say based on an XML template. O my god.. I think I just wrote a design document!

      namaste, Nitin Koshy http://devwaves.blogspot.com ...and I thought I knew

      J 1 Reply Last reply
      0
      • N nitikin

        I might have done it this way: Have a class for each file type. 1.) Find out the class/provider which knows how to handle the given file type from the list of registerd handlers (maintained in a global variable list). eg:= FileProcessorTXT, FileProcessorCSV etc, all deriving from FileProcessorBase. 2.) If there is no registered handlers, error! 3.) If there is a registered handler, call the virtual function Validate() which should check the format. eg:- FileProcessorTXT's Validate() needs to bother about TXT file validation only. The above classes job is to validate, read the special file types. Now we might need to introduce a common interface to talk with the DB. This could be a class/function on the FileProcessorBase such that each of the descendants would return data in the accepted format; say based on an XML template. O my god.. I think I just wrote a design document!

        namaste, Nitin Koshy http://devwaves.blogspot.com ...and I thought I knew

        J Offline
        J Offline
        JoeContreras
        wrote on last edited by
        #3

        Thanks I appreciate your input

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups