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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Urgent!!--Layer Isolation using ArrayList??

Urgent!!--Layer Isolation using ArrayList??

Scheduled Pinned Locked Moved Database
designhelpquestion
2 Posts 2 Posters 0 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.
  • O Offline
    O Offline
    obymathew
    wrote on last edited by
    #1

    I have this case: I am working on a screwed up application in which arraylist are using for implementing layer isolation. i.e., It is using some function to convert each and every values it return from the SQLDataReader into an arraylist and then pass it to the UI Layer. I want to know that whether this will help in anyway or will cause an overhead to the application(remember the appn. is screwed up!!) :confused:

    D 1 Reply Last reply
    0
    • O obymathew

      I have this case: I am working on a screwed up application in which arraylist are using for implementing layer isolation. i.e., It is using some function to convert each and every values it return from the SQLDataReader into an arraylist and then pass it to the UI Layer. I want to know that whether this will help in anyway or will cause an overhead to the application(remember the appn. is screwed up!!) :confused:

      D Offline
      D Offline
      Daniel Turini
      wrote on last edited by
      #2

      obymathew wrote: I want to know that whether this will help in anyway or will cause an overhead to the application This is the wrong way of decoupling layers: 1. This will add both complexity and overhead - you'll need a lot of casting on the UI layer, as ArrayLists store only objects. 2. Probably your data is being put on specific positions (e.g, al[1] is the customer name, al[2] your customer address, etc. This makes the application hard to debug, and change impact analysis very hard to do. What I suggest: If you still want or need to keep a strong isolation between these layers (e.g., the data or the UI layer can be used with other implementations) you can: Create a 3rd assembly, which will define the interfaces that'll be used by both the data layer and the UI layer. From the data layer, return those interfaces, or arrays of those interfaces. To allow incremental changes, and to not disrupt everything when changing a method, provide a method on each interface that converts that data to an arraylist. Before doing any changes, plan ahead a bit: make a backup (actually, you should use source control), create some basic unit tests and only then start working. Don't forget that you may need to maintain two versions while you're converting things if your users need changes/bug corrections. Yes, even I am blogging now!

      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