• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

Class and database

Here is a snip of the Task class.
I need to work with a DeveloperID and also the Developer's Name
When displaying to UI, I need to show the developer's, but when working with the database I need the developerid

Currently, the task class with get filled with data from the database and my
sql query only has the developerid.

Should I modify the query to include the the developer's name? (I would need to create a join and then pull from the
developer table)

Or should I achieve this another way?
Why or why not?

Public Class Task
 
   Public ReadOnly Property TaskID() As Integer
        Get
            Return mTaskID
        End Get
    End Property

    Public ReadOnly Property ProjectID() As Integer
        Get
            Return mProjectID
        End Get
    End Property

    Public ReadOnly Property DeveloperID() As Integer
        Get
            Return mDeveloperID
        End Get
    End Property

  'Constuctors...etc

End Class
0
JRockFL
Asked:
JRockFL
1 Solution
 
joesthebighmoeCommented:
JRock, is your intention to build an object-oriented system, more specifically a business-object-oriented system? If so, I'm not sure exactly where to start. At first glance, your Task object looks a bit useless. It has no business meaning whatsoever, but rather looks like some sort of relatinship construct.
-Joe
0
 
VBRocksCommented:
If you need to include the Developer Name for the user to see, go ahead and include it.  Since your
properties are ReadOnly, updating the database is not an issue.



0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

Tackle projects and never again get stuck behind a technical roadblock.
Join Now