Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

Help in UML class diagram

Question posted by: nehas (Newbie) on March 12th, 2008 07:43 AM
I am learning UML diagrams on my own but have a problem in beigning itself I am unable to understand that what are class diagrams in my project. One of my friends suggested that all the pages in my web page form each of th class is thet true or not . Please Help me .
gits's Avatar
gits
Moderator
3,209 Posts
March 14th, 2008
09:28 AM
#2

Re: Help in UML class diagram
hi ...

i wouldn't construct it that way ... a class is a kind of 'prototype' for an object so let me speak in javascript terms and demonstrate it with some easy code:

1. we create a class:

Expand|Select|Wrap|Line Numbers
  1. // constructor
  2. function PAGE() {
  3.     this.add_events();
  4. }
  5.  
  6. // define a method to add some events to the page
  7. PAGE.prototype.add_events = function() {
  8. }

now we construct the webpage

Expand|Select|Wrap|Line Numbers
  1. <html>
  2.     <head>
  3.         <script type="text/javascript" src="page_class.js"/>
  4.     </head>
  5.     <body onload="var page = new PAGE;">
  6.     </body>
  7. </html>

as you can see in the onload we create an instance of the PAGE-Class and the page is not a class but an instance or call it an object if you want to see it that way

classes in a webproject could be a PAGE-class, a TREE_MENU-class, an AJAX_REQUEST-class etc. ... ok? and in your pages you use them to create instances from them that has their own data, their own methods ... i hope it would help you ...

kind regards

Reply
Reply
Not the answer you were looking for? Post your question . . .
189,846 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Software Development Forum Contributors