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. Design and Architecture
  4. how to show database table in a class diagram

how to show database table in a class diagram

Scheduled Pinned Locked Moved Design and Architecture
questiondatabasetutorial
4 Posts 4 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.
  • Q Offline
    Q Offline
    Qobacha
    wrote on last edited by
    #1

    Is it correct to show the database table in class? I have a class diagram that has objects that save records to a database. So i don't know whether i should show the database table in the class diagram or not. If not allowed then how can I show the relationship between the object and a database? That is how do map objects to a database?

    J M V 3 Replies Last reply
    0
    • Q Qobacha

      Is it correct to show the database table in class? I have a class diagram that has objects that save records to a database. So i don't know whether i should show the database table in the class diagram or not. If not allowed then how can I show the relationship between the object and a database? That is how do map objects to a database?

      J Offline
      J Offline
      jschell
      wrote on last edited by
      #2

      Qobacha wrote:

      So i don't know whether i should show the database table in the class diagram or not.

      Probably not. Instead you would have a object data model diagram. However if the project is small enough such that there is only one or two diagrams and only a couple of tables then yes that is ok. However you need to make it clear that that they are data objects rather than class objects.

      1 Reply Last reply
      0
      • Q Qobacha

        Is it correct to show the database table in class? I have a class diagram that has objects that save records to a database. So i don't know whether i should show the database table in the class diagram or not. If not allowed then how can I show the relationship between the object and a database? That is how do map objects to a database?

        M Offline
        M Offline
        manoranjan
        wrote on last edited by
        #3

        You seem to be describing Table Data Gateway pattern (Fowler, Patterns of Enterprise Application Architecture). This class inserts or updates records in a particular table. The convention is to name the class after that table. e.g. The class that updates rows in User table is called UserGateway (or simply User). Hence, the association between the class (which contains code in C++/C#/Java language to update the table) and the table is described by the name itself. There is no need to explicity show the relationship. However, there is no restriction to show tables in a class diagram. For example, you may want to describe database schema in UML. All you need is to create a new stereotype, e.g. <>. This stereotyped class can then represent database tables.

        1 Reply Last reply
        0
        • Q Qobacha

          Is it correct to show the database table in class? I have a class diagram that has objects that save records to a database. So i don't know whether i should show the database table in the class diagram or not. If not allowed then how can I show the relationship between the object and a database? That is how do map objects to a database?

          V Offline
          V Offline
          VishwaKL
          wrote on last edited by
          #4

          Hay you can refer this links http://www.visual-paradigm.com/product/vpuml/tutorials/generatecdfromerd.jsp[^] http://msdn.microsoft.com/en-us/library/dd409437.aspx[^]

          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