[Java and all else] How do you document DB design?

Hello,
Although most of the technical choices are explicit in SQL (UniqueKey & ForeignKey constraints, indexes,...), the semantics of the data columns and their constraints seem better served as plain human-readable comments ("ID column: identifies the plane copy; 6 figures are enough as we don't expect to sell more than 1 million planes in a foreseeable future...").
In my current system, (EJB-based, but the DB schema is not created by the JPA-compliant ORM, but via SQL scripts), I see the following ways to write and maintain this documentation:
- SQL comments in the schema creation and patch scripts
- Javadoc comments in the Java source of the Entity classes.
- UML notes in UML diagrams(1)
- external "Architecture and design" document.
All 4 of them are used, sometimes inconsistently, for various parts of the design choices; I mean, the docs do not contradict themselves (not yet, but it's a mere question of time), but some tables are commented in SQL scripts, others are in design docs, and the details for some columns are in entity javadocs. Although each developer may find it handier to "write" the doc via his preferred medium, it becomes increasingly difficult to "maintain" theoverall documentation.
Our current situation is that most of the project team members are Java developers, so it would probably be better accepted and served if we standardized that we document DB tables and columns in Java source, but I am worried that:
- someone else pouring over our DB (ex: DBA helping us to optimize things, or other team developping a data-mining tool to leverage the historical data in DB) may not be as comfortable with Java
- this may not cover all design choices of the DB schema:
- - - - first, although that is the case currently, in the future there might not be a 100% 1-1 mapping between e.g. each entity class and a DB table. Maybe some columns will not need to be mapped anymore,...
- - - - second, I fear some DB constructs are not amenable to Java counterparts; no accurate idea there, I'm not an SQL nor JPA expert, but I presume Indexes, table partitioning, tablespaces, for example (yes, the DBMS is Oracle :o) are not taken into account in JPA mapping.
And if we document those choices at the SQL level (my preferred idea so far), this will gradually make the javadocs in the entities obsolete, or removed altogether, and that will make future maintenance of the Java source risky.
How do you document your DB design in general?
Do you have specific advices for my case?
Thanks in advance,
J.
(1) Just for the record, here are a few posts that refer to modelling the DB in UML:
[A post on this forum highlighting that UML 1.4 standardizes a notation for RDB modelling|http://forums.sun.com/thread.jspa?messageID=1383724#1383724]
[A DB modelling tutorial|http://www.tomjewett.com/dbdesign/dbdesign.php] (not sure whether it leverages the standard mentioned above :o)
P.S.: "Java and all else" as in, damn, I'd love to use the familiar JDC forums and people to discuss not only Java-related issues, but also [all other things that surround Java|http://forums.sun.com/thread.jspa?threadID=5422264&tstart=0] (other technologies, processes, people) and enable to make workable systems out of Java code.

jduprez wrote:
Thank you again.
A couple more questions:
2. Table, and proc dictionary maintained as one or more text files. Those files and schema are all in source control.Do you mean, a proprietary text format (a la tabledesign.txt), or +.sql+ source files? Again, you seem to suggest the scehma info is present in two locations.I didn't say two locations unless you meant files. Then yes.Yes I meant two files. I trust the team to get the doc file lagging a few revisions behind the SQL file, and to correct that I would have to include one more step in the review process (e.g. "review CM actions to check that the doc file is updated consistently with the SQL source").
The tool I wrote would throw errors if the comment file didn't match the schema. And if comments were not provided. That of course doesn't stop someone from documenting a table with "a table".
You can of course keep the addtional info as special comments in the SQL, but when I did this, and even in retrospect, it seems better and perhaps easier to keep them seperate. I have done special comments in SQL before and it seems a bit of a kluge but you do have the single source. But in that case I was the only one maintaining it too.What do you mean by "special"?For code generation I have a schema file with the following (pseudo sql.)
    create mytable
       mytable_id int,
       column_foo varchar(10);
       column_fum varchar(20)
        -- Query: for_a_query (column_foo, column_fum)
    )The generator consumes the schema and generates the standard CRUD which would include a query based on the primary key.
The above comment is used to provide an additional query where the proc is named 'for_a_query' (munged with table name) and takes two parameters (column_foo, column_fum) whose type/name matches those of the table.
If we don't try to generate a browseable HTML out of the schema (although the idea is appealing, I don't have the resource to make such a tool), do you see anything kludgy in maintaining SQL comments interpersed within DDL code?
Of course that is doable.

Similar Messages

  • [Java and all else] Requirements tracking, testing, and versioning

    Hello,
    as a semi-experimental subject, I am considering managing requirements and test documents in the same version control system as the code.
    For some reasons, this versioning policy doesn't seem mainstream, so I'd like to have your opinion on that.
    +N.B.: the prefix "java and all else" refers to the fact that I'm using this area to post a message that is related not only to Java but also to other topics (people, processes, tools,...) that help program in Java - so this post is not really off-topic either. For the record, I filed a suggestion to open a dedicated forums to discuss topics like that, although it hasn't received enthusiastic support so far :o(...+
    Here is how I had imagined to proceed:
    - requirements document gets edited and stored as text in the VCS
    - test plan (basically a matrix of which tests cover which requirements) goes into the VCS as well, text or binary
    - test instructions (detailed steps, actions, expected results) are stored as text in the VCS
    - test results - I do'nt know yet, but I planned to store them as text (lists of testId=result) in the VCS (I'm not sure indeed, that those would go into the VCS)
    The advantage of versioning those as text is that all VCS clients support easy-as-a-click history browsing and diff capabilities.
    Diffs and logs are useful to trace when and why a requirement has appeared, evolved, obsolated,... Especially in long-lived systems whose maintenance crew rarely embeds "historical" pioneers who developed the original systems.
    My questions:
    1) Is it good practice to version such docs in the same repository as the code?
    I've never seen this done.
    - In half of the shops I've been these docs are not really versioned (the PM considered it enough that the latest applicable version of the docs was available)
    - The other half has used versioning systems ranging from ad-hoc (shared folder acting as repository of all versions) to "document management systems". I found such tools to be developer-unfriendly (poor diff capability, poor text searching), and developers to be office-document-reluctant (mostly because of the shortcomings of the doc format and doc management systems).
    - The third half <wink to aficionados of French cinema> used dedicated softwares (Test Director, RQM,...) to manage requiremetns, test plans, test cases, test results,... The drawback is that the developers were hardly involved in using such tools, and even when they were, were not trained to use the administrative and metadata capabilities (who modified the test steps, when and why?).
    On the contrary, developers would easily and gladly browse histiry, check diffs, etc... on text documents versioned using their daily-used source control system.
    2) Are there "standard", preferrably text-based, formats, for the documents listed above?
    Each and every organization I've seen had its own format, but most items have equivalents in all organizations, even if disguised under different terminologies. I have no formal education or training in quality assurance, but I guess some ISO or CMM norms define those recurring items, and I expect some abstract XML format might exist
    3) Are there tools already that cover edition and exploitation of such formats, or why not, of the versioning of such formats (naive example, graphing the pass rate of tests over time)?
    A pet project of mine is to develop and open-source some Swing UI to do this, but existing tools would save me the trouble.
    I'm looking forward to reading about your own experience.
    Best regards,
    Jerome.
    Edited by: jduprez on Jun 4, 2010 10:33 PM
    Fixed link.

    I don't have data on comparative bug rates because we did not do studies focused on that. This stuff was mostly driven by convenience #) considerations.
    Subjectively, yes it seemed to have lower bug rate compared to maintaining documents in, say, pdf format (like our doc writers did with User/Dev guides). BTW doc writers are another kind of guys who dislike plain text.
    As for using test results history the way you describe - agree, that makes some sense. Now that you mention it I recall using it myself that way, in one of the projects where testers managed to establish really convenient way to assess test execution history. After I figured how easy it was, I began using it. Quite helpful indeed.
    Regarding "tool or format that mapped tests to specific requirements" in your original post - did you consider Polarion? IIRC it supports mapping requirements to test descriptions. Telelogic DOORS are maybe also capable of that but I am not completely certain.
    #) convenience -- BTW we maintained test descriptions not in plain text but in simple HTML (you know few tags one can use in javadocs). With limited line length, it is almost as VCS friendly as plain text, even with tables:
    <!DOCTYPE "stuff to make HTML validator happy">
    <html><title>test description</title>
    <body>
    <table>
      <tr>
        <td>test id</td>
        <td>synchronized.10988343</td>
      </tr>
      <tr>
        <td>instructions</td>
        <td>
          <ul>
            <li>sacrifice a goat
              <ul><li>under the full moon</li></ul>
            </li>
            <li>twirl counterclockwise
              <ul><li>until you barf</li></ul>
            </li>
        </td>
      </tr>
      <tr>
        <td>pass criteria</td>
        <td>
          <ul>
            <li><b>pass</b> if method is synchronized</li>
            <li><b>fail</b> otherwise</li>
          </ul>
        </td>
      </tr>
      <tr>
        <td>comments</td>
        <td>
           <a href="http://forums.sun.com/thread.jspa?messageID=10988343#10988343">
           click here for details</a>
        </td>
      </tr>
    </table>
    </body>
    </html>
    {code}
    We were also using [HTML validator|http://validator.w3.org/|tool] tool to automatically catch simple syntax mistakes like missing tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • HT201210 When trying to update iOS 7.0.4 I get a message saying that the update has failed. Has anyody else had this problem and if so, how did you get round it?

    When trying to update to iOS 7.0.4 I get a message saying that the update has failed. I've followed the instructions on Apple Support. Has anybody else had this problem and if so, how did you get over it?

    Check For Updates.
    http://i1224.photobucket.com/albums/ee374/Diavonex/Album%204/deb765f74dc0acb6038 d1fc55eed7fce_zps9330117d.jpg

  • I deleted the picture in iphoto, then emptied my iphoto trash, but the picture is still showing on my computer when i go into my trash under "all images" How do you delete pictures even when you empty the trash and they stay in the computer?

    I deleted the picture in iphoto, then emptied my iphoto trash, but the picture is still showing on my computer when i go into my trash under “all images” How do you delete pictures even when you empty the trash and they stay in the computer?

    Wtih iPhoto 9 when the iPhoto Trash is emptied the files get moved to the Trash bin in the Dock as a second chance to change your mind.  Look in the Dock's Trash bin.
    OT

  • HT1386 hiya ive recently got the iphone4s and have been trying to register it onto the itunes on my laptop but it wont do this for some reason, has anyone else had any problems doing this and if so how did you resolve the issue ? many thanks yvonne

    hiya ive recently got the iphone4s and have been trying ever since to get it to sync with my itunes account on my laptop but everytime i try to register it, it freezes up on me and then i have to do the whole process again without luck has anyone else had this problem and if so how did you resolve it
    many thanks
    yvonne

    If you aren't receiving password reset emails and your security questions don't work, someone has hijacked your account.
    This happened to me.
    You need to use Expresslane to contact iTunes support to regain access to your account ASAP.

  • When you sighn in and out of an ios device some of the data fom the device sighned in stays after sighning out. Is this the same for PC and if so how do you delete all the data from my icloud from the pc

    When sighning in and out of an ios device some of the icloud data from the icloud account used to sighned in stays even after sighning out. Is it the same on pc icloud and if so how do you delete it. ( This is the online site by the way.)

    Hi turintest2
    Thanks for taking the time to respond - however your reply didn't really help as you haven't explained how to delete the compilation album that had been created.
    I managed to sort it out by doing the following (I'm posting this so that it may help others).  I don't know if this is the simplest/most elegant solution - but it works.
    In iTunes, find the compilation (in my case, the 153 songs) and, starting with the first song, follow this procedure:
    On the iPhone go to 'Songs' and scroll down the list until you find the first song that was listed in iTunes (above).  You should notice (as in my case) that the song will have the correct title (and artwork too if you'd found this previously before making the compliation) but the wring artist.
    Swipe LEFT and press the 'Delete' button.
    Repeat with second song in iTunes list, deleting the individual songs from the iPhone, one by one.
    Although tedious, this seemed to work for me.  Reason for doing down the iTunes list is that it is in a pseudo-alphabetical order and I wanted to make sure I'd got every one.
    Now busy re-importing the original albums from CD.
    Thank you APPLE for making this such a laborious process.  Why can't designers actually TEST the products they design so that they can appreciate first-hand the likely problems?
    Anyhow, thanks turintest2 for trying to help me - it was appreciated.
    RB

  • I have mac os x 10.6.8. The system preferences doesn't show java at all. How can I install java please?

    Hi! 
    I have mac os x 10.6.8. The system preferences doesn't show java at all. How can I install java please?

    Don't change your story now. You did not say through Apple, you first gave a link to this site,
    http://www.java.com/en/download/apple.jsp
    You said, "Go there and download the latest version of Java"
    that plainly says,
    "Mac OS X Version 10.6 and below
    Use Software Update available on the Apple menu to check that you have the most up-to-date version of Java 6 for your Mac."
    This corroborates me saying that Java for Mac OS 10.6 is done through Software Update, no where else.
    If any Mac OS 10.6 user does not have Java on their Mac, they get it from Apple just as the link you provided shows it is from Apple. Not Oracle. You have provided the evidence that plainly contradicts yourself.
    This is your second link that is to Apple.
    http://support.apple.com/kb/DL1573
    Just to go over this again. Software Update not only updates Java to the latest, but if Java does not exist at all, SU will install it from scratch. And in doing so will be the latest version.
    Providing a link to Oracle's site is useless information that does not get Java installed on a Mac running 10.6.
    Message was edited by: roam

  • Can you have two seperate acounts on one MAC and if so how do you do it?

    Can you have two seperate acounts on one MAC and if so how do you do it?

    Look at Method One in this document:  How to use multiple iPods, iPads, or iPhones with one computer, http://support.apple.com/kb/HT1495

  • How do you document specific sections of a VI?

    Once in a while I'll use a VI (perhaps one of mine or one from vi.lib) to do something in an unusual way.  How would you document this usage so that when you go back to it some weeks later you don't have to scratch your head wondering why you did it that way?  A free label near that VI (or wire) clutters the diagram and gets lost when doing a diagram cleanup (ctrl-U).
    I can think of a couple of ways that NI could help us out.  One would be to allow me to attach a documentation property to an instance of a VI or wire.  This documentation would show up as either a tool tip when you hover the mouse over the object, or in the Context Help window.  An indicator would be needed on the VI or wire to let me know that there is documentation available.  The indicator may be something that resembles a coersion dot though in a different location so it won't be confused as a coersion dot.
    On a related note, I've seen a few diagrams that have transparent labels on top of a wire indicating what that wire does.  This is a pretty good kludge to document a wire.  Perhaps a label property can be attached to the wire in much the same way as the documentation property I describe above.  The label would be visible and automatically displayed on top of the wire.  The key difference is that the label would be owned by the wire and could not get misplaced.
     - les

    I like the way NI documents code in some of their examples.  They use small labels with a number or letter in it.  Then below is a huge label with explanations of each numer of letter.  See the picture:
    Message Edited by tbob on 09-23-2008 12:27 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    Dynamic Generation and Acquisition-Source Synchronous_BD.png ‏18 KB

  • IPhone 6 recently stopped ringing and making text alert sounds since most recent upgrade to ios 8.1.1, has anyone experienced this, and if so, how did you correct?

    AFter recent upgrade to ios 8.1.1, my iphone 6 no longer makes text alert sounds and ring does not sound for incoming calls (except on car bluetooth).  has anyone experienced this, and if so, how did you correct?

    I had the same problem until tonight. Played with ring tones, do not disturb, volume, and everything else posted. What I found is that when you go to sounds/text tone, there are two types of tones in the scrolling menu. The top set of tones are for alert tones and the bottom set are ringtones. They are separated by a gray bar that states their purpose. Many of the tones are the same name. You need to set your text alert in the Ringtones and reminders, alarms, and such in alerts. The weird thing about this menu is when you go to sounds/ringtone the menu is reversed. Mine works in locked mode or unlocked now. I have an Iphone 6 8.1.2. My problem started after my latest OS upgrade. Hope this helps.

  • Passcode are all numbers how do you change to letters

    passcode are all numbers how do you chane them to letters

    This might help
    Press the SETUP button on your printer's control panel.
    Using the arrows, select DEVICE SETTINGS, press OK.
    Select LAN SETTINGS and press OK.
    Select Wireless LAN Setup and press OK.
    If a message appears to press the WPS button, press STOP to cancel.
    Select STANDARD SETUP from the next screen that appears and press OK.
    Highlight your access point or router and press OK.
    Press OK again to confirm the access point name.
    Enter your passphrase using the keypad to the right.
    At the screen where you enter your passphrase, in the top right corner of the LCD screen you should see a :1 . This indicates that you are in numeric entry mode. If you press the asterisk key (*) it will switch to :A or uppercase letter mode, pressing asterisk again with switch to lowercase letter mode. To enter a letter in either letter mode, you will press the associated number key to cycle through the available letters. For example: To enter a letter "c", you will press the "2" key three times.
    Press OK when done.
    The LCD screen will say "Connected" if the password is correct.
    John Hoffman
    Conway, NH
    1D Mark IV, Rebel T5i, Pixma PRO-100, MX472

  • How do you document ABAP programs?

    hi
    How do you document ABAP programs? Do you use program documentation menu option?
    Regards
    Ashok Kumar

    Hi,
      good for selection screens:
    when in the ABAP Editor, in edit mode, choose
    Goto->Documentation.
    This gives you a SAPscript-type screen with many headings. Enter the instructions that you want your end-user to see when they run the program. SAP supplies many different headings here, choose the ones relevant to your program.
    Save and activate.
    When you run your program, when you are at the selection screen, choose
    Help->Application Help
    and you see your user documentation!
    I expect Sapscript experts can make this look even better, with links to other help topics etc.
    Regards

  • How do you document EJBs?

    I want to document my EJB client-wise, meaning that I need docs for users of
    my EJBs. I used to write javadocs comments for interface and home classes.
    But I use JBuilder and those classes are being regenerated often. How do you
    document your EJBs?

    "GD" <[email protected]> wrote in message news:[email protected]..
    I want to document my EJB client-wise, meaning that I need docs for users of
    my EJBs. I used to write javadocs comments for interface and home classes.
    But I use JBuilder and those classes are being regenerated often. How do you
    document your EJBs?I'd look for documentation options in the JBuilder
    setup. I don't beleive there is no one.
    Regards,
    Slava Imeshev

  • My daughter has downloaded free games from the App Store and I have been charged in excess of £200 and I don't know why has anyone had the same issue and if so how did you get your money back

    My daughter has downloaded free games from the App Store and I have been charged in excess of £200 and I don't know why has anyone had the same issue and if so how did you get your money back

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    To help avoid future transgressions set the Restrictions for In-App Purchases...
    Settings > General > Restrictions
    Understanding Restrictions  >  http://support.apple.com/kb/HT4213

  • HT1351 Can you take the music off the existing library on the ipod and sync it to a new itunes library?? and if so how do you do this???

    Can you take the music off the existing library on the ipod and sync it to a new itunes library?? and if so how do you do this???

    See this excellent User Tip from another forum member turingtest2 on how to recover content from your iPod back into iTunes.
    https://discussions.apple.com/docs/DOC-3991
    B-rock

Maybe you are looking for

  • In need of my serial number

    So almost 4 years ago, I purchased what was then called the Production Suite which consisted of Final Cut Pro HD, DVD Studio Pro 3, Motion and others. Anyway, I'm in desperate need of using Final Cut tonight and tomorrow, but (after migrating to a "n

  • Which 7200rpm internal HD for macbook pro - Live pa use!

    Hi all I'm upgrading the internal HD of my new macbook pro which we will be using for our live pa's and can do with a little help in chosing the right one. First thought was the Seagate momentus 2.5" 7200rpm asg (500Gb) but heard some horror stories

  • Why does my OWB not work?

    After I installed Oracle Warehouse Builder(2.1),and ran it, I found there was nothing displayed at the cental screen, where a navigating tree had been expected. Only some icons was there. For example, I clicked the 'Project' bar,but nothing appears.

  • Youtube videos are grey when Fullscreen and updating Real Player doesn't help

    Youtube videos are grey just like you describe them in "Flash 11.3 doesn't load video in Firefox" but updating RealPlayer does nothing to help.

  • Chat Colors not Showing up for PC AIM Users

    This question has been asked dozens of times from what I can tell of the archives but there is no real answer to this question. I am using iChat and have my font color changed to my preference, all other ichat users can see my font and color, no AIM