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. Visual Basic
  4. Working with classes and data access logic...

Working with classes and data access logic...

Scheduled Pinned Locked Moved Visual Basic
databasewcfsysadminbusinessxml
4 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.
  • C Offline
    C Offline
    Chris Quick
    wrote on last edited by
    #1

    I've been doing alot of research but coming up dry on strategies for implementing business rules and data access. Microsoft's patterns and practices documentation suggests seperating the actual data logic from the business class. For example, I have the following class:

    Public Class TimeEntry
        Private _EntryID as Integer
        Private _StartTime as DateTime
        Private _EndTime as DateTime
    
        ' Methods and properties to work with and expose private members
    
        Public Sub Save()
            ' Save this time entry object depending on the current state of
            ' the application
        End Sub
    End Class
    

    I want to be able to save this class either in a database (when in a connected environment) or to a data cache (xml or binary files). I am using the Data Access Application Block for SQL. However, I need the ability to connect to the database and create and update a TimeEntry object in any of the following ways: 1) Web services (for offsite connection to the database) 2) SQL Client (when onsite and connected to the local resources) 3) Data Caching/XML (when offsite and disconnected from any network) Can anyone suggest books or articles that can introduce this concept? I have been developing primarily thin or rich clients. This is the first time I have looked into a smart client development project so I am having a difficult time grasping these concepts from MSDN. Thanks!

    S 1 Reply Last reply
    0
    • C Chris Quick

      I've been doing alot of research but coming up dry on strategies for implementing business rules and data access. Microsoft's patterns and practices documentation suggests seperating the actual data logic from the business class. For example, I have the following class:

      Public Class TimeEntry
          Private _EntryID as Integer
          Private _StartTime as DateTime
          Private _EndTime as DateTime
      
          ' Methods and properties to work with and expose private members
      
          Public Sub Save()
              ' Save this time entry object depending on the current state of
              ' the application
          End Sub
      End Class
      

      I want to be able to save this class either in a database (when in a connected environment) or to a data cache (xml or binary files). I am using the Data Access Application Block for SQL. However, I need the ability to connect to the database and create and update a TimeEntry object in any of the following ways: 1) Web services (for offsite connection to the database) 2) SQL Client (when onsite and connected to the local resources) 3) Data Caching/XML (when offsite and disconnected from any network) Can anyone suggest books or articles that can introduce this concept? I have been developing primarily thin or rich clients. This is the first time I have looked into a smart client development project so I am having a difficult time grasping these concepts from MSDN. Thanks!

      S Offline
      S Offline
      Steven Campbell
      wrote on last edited by
      #2

      I recommend Data Access Patterns by Clifton Nock. Also, P of EAA by Martin Fowler.


      my blog

      C 1 Reply Last reply
      0
      • S Steven Campbell

        I recommend Data Access Patterns by Clifton Nock. Also, P of EAA by Martin Fowler.


        my blog

        C Offline
        C Offline
        Chris Quick
        wrote on last edited by
        #3

        Which one of these books would be better for introducing concepts in a simplified way? I've read Expert One-on-One Visual Basic .NET Business Objects[[^](http://Expert One-on-One Visual Basic .NET Business Objects "New Window")], but I quickly got lost in the concepts.

        S 1 Reply Last reply
        0
        • C Chris Quick

          Which one of these books would be better for introducing concepts in a simplified way? I've read Expert One-on-One Visual Basic .NET Business Objects[[^](http://Expert One-on-One Visual Basic .NET Business Objects "New Window")], but I quickly got lost in the concepts.

          S Offline
          S Offline
          Steven Campbell
          wrote on last edited by
          #4

          Your specific question was about how to decouple your objects from the method used to persist them (database, web service, etc). This can be achieved in many ways, so I am uncomfortable recommending a specific approach without knowing more about your environment. The books I mentioned (esp. P of EAA) cover the subject in detail, but they are not light reading, so I am not sure that they would help. There are some articles on this site, in the Design and Strategy section that may help. If you can find a good systems architect, that would probably be your best bet.


          my blog

          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