[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Class and database

Posted on 2007-10-04
Medium Priority
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

Expert Comment

ID: 20014833
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

VBRocks earned 2000 total points
ID: 20015750
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month18 days, 18 hours left to enroll

834 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