Class and database

Posted on 2007-10-04
Last Modified: 2010-04-23
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
            Return mTaskID
        End Get
    End Property

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

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


End Class
Question by:JRockFL
    LVL 7

    Expert Comment

    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.
    LVL 27

    Accepted Solution

    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.


    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Introduction When many people think of the WebBrowser ( control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    730 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

    15 Experts available now in Live!

    Get 1:1 Help Now