Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

RE: FN-FORUM: normalisation for classes???

date posted 26th November 2007 00:00

Ben Johnson (Neogic) F wrote:
> Stepping back slightly, is the purpose here to create UML =
documentation
for
> a client after-the-fact, or to aid the design process? If it's the =
former,
> then use an automated diagramming tool. If it's the latter, then =
you're
> using UML back-to-front: database tables / code classes are the end
product,
> not the starting point!=20
=20
James wrote:
> The aim of the class diagram is to try and help me establish what I =
need=20
> to code before i start coding, so yes I'm using it as a design tool, =
is=20
> this not right?

Nope - the database structure is just as much an implementation decision =
as
your code classes. You should 'model' the problem area first, identify =
real
world tangible objects/concepts (e.g., Customer, Account, Transaction) =
and
have a class for each. Here's some reading on why there usually isn't a
direct mapping between database structure and your Class Diagram:

Why Data Models Shouldn't Drive Object Models (And V.V.)
http://www.agiledata.org/essays/drivingForces.html

The following page is a good guide to techniques for identifying what is =
a
class, what is a relationship and what are properties. It's written from =
the
perspective of Entity Relationship Modelling (ER Diagrams), so the names =
are
slightly different (entity =3D class, association =3D relationship, =
attribute =3D
property), but the recommendations are still good (ignore the very last
section though, "Recording Information in Design Document"):

Identifying Data Objects and Relationships=20
=20
http://www.utexas.edu/its-archive/windows/database/datamodeling/dm/object=
s.h
tml

As you move closer to implementation, you also add more =
solution-specific UI
objects, such as CustomerAccountScreen (this is perhaps the main =
difference
between ER Diagrams and Class Diagrams). In a web application, a UI =
object
would typically be implemented as a page, which receives input from the
browser, sends messages to other object and outputs mark-up.

Including 'end-point' objects like this helps you to trace how the =
objects
will collaborate to satisfy each Use Case (user task). You can use a UML
Sequence Diagram to do this. Don't forget that Agile Modelling =
principles
state that you can adapt the level of detail in your UML diagrams to =
suit
your needs, so feel free to use very simple Sequence Diagrams - they are
usually a means to an end, unless the client requires them in standard
format.

Once you are confident you have all the objects you need, the document =
will
help mapping classes, properties and relationships to elements in the
database (tables, etc):

Mapping Objects to Relational Databases: O/R Mapping In Detail
http://www.agiledata.org/essays/mappingObjects.html

It's a bit of a read, but I found it very useful for concrete strategies =
for
mapping an object model to a database structure. Note that there are =
other
ways that data may be stored (e.g., Session variables, XML files, =
cookies,
etc), which is one of the many reasons classes won't map directly to
database tables.


Hope that helps, let me know any other questions. Note I'm no expert on =
UML
modelling (ER Diagrams, Data Flow Diagrams, et al were still dominant =
when I
studied at Uni '98-02!), so comments from the group are welcome.

Cheers, Ben

--
Ben Johnson, Neogic Web Solutions
// design . development . managed hosting

w | http://www.neogic.com
t | +44 (0)1242 808 262
e | [EMAIL REMOVED]





Messages by Day
November 30th 2007
November 29th 2007
November 28th 2007
November 27th 2007
November 26th 2007
November 25th 2007
November 24th 2007
November 23rd 2007
November 22nd 2007
November 21st 2007
November 20th 2007
November 19th 2007
November 18th 2007
November 17th 2007
November 16th 2007
November 15th 2007
November 14th 2007
November 13th 2007
November 12th 2007
November 11th 2007
November 10th 2007
November 9th 2007
November 8th 2007
November 7th 2007
November 6th 2007
November 5th 2007
November 4th 2007
November 3rd 2007
November 2nd 2007
November 1st 2007


Messages by Month
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000