Thread: Uml

Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0

    Uml


    Couldn't find any other section to post to.

    I am designing a sequence diagram, but am unsure of one thing. In sequence diagram tutorials, you always see that the messages sent and the lifelines are related to the database table. Well I have very few tables, and methods. Same problem with class diagram.

    Question

    1- If my methods don't access the table in the database, under which class do I put that function to? Class diagrams usually have functions where an operation is done on that table. So what if your function doesn't use any table. Do we include it in the class diagram?

    2-Similar problem with sequence diagram. The way the tutorials usually mention sequence diagram, we describe the sequence of events that happen on the tables. What if the website works mostly with code execution and not database table, what happens to the sequence diagram.

    thanks

    James
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2009
    Location
    Hobart, Tasmania
    Posts
    475
    Rep Power
    287
    With regard to sequence diagramming ... you're attempting to diagram the sequence of events.

    If your problem involves manipulating tables (as many tutorials do) then the "steps" will likely involve databases.

    It sounds like you're trying to flesh out the main classes and program flows in a website ... you've mentioned it isn't heavily DB based ... so it is likely your diagrams will have different classes and methods to those presented in the tutorials you've seen.

    At this point, your question is a little like "how do I design a thing that isn't a car?" The small amount of information you've provided doesn't reduce the solution space much.
    Latery Matey
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0
    Thanks for your reply. Yes it is a website.

    Does it make a difference if the programming was structural or object oriented?

    The thing is, I don't have any classes in my website. In the UML tutorials, we would just be given a problem, and just design the sequence diagram together with usecase and class diagram, without any code implementation. In the tutorials we'd make up functions like getpostcode(), getaddress(), getphoneno() which would go under some Contact table for example. In the class diagram these methods would be under the Contact table. These would also be used as messages for the sequence diagram. getpostcode() would make sense to be used in the sequence diagram, because the definition would be something like "select postcode from contact;". This would be an operation on the Contact table, so would be straightforward to use in the sequence diagram.

    But say you have written a function which uses POST or GET to pass information. Do you include that in the sequence diagram. Or you use mysql_query(), store it in a variable, compare values etc, but there is no function.

    Now the problem seems to lie, that I am designing the sequence diagram after the implementation. I have functions, but not all of them seem to be doing a direct operation on any table. For example, user logs in. Thats simple because I have a login table. But I have no method that does an operation with the login table. I have many mysql_query functions. But when drawing the class diagram under which tables operation compartment do I put mysql_query(), because it is used on many pages regardless of the table.

    So if code on a webpage isn't making any changes to the databases, or a funtion that works using mysql_query(), what would the sequence diagram for that be like? In our tutorials most sequence diagrams are about the class diagram and those operations in the class diagram. So I don't see how functions written in the source code, that is not a database operation, would be used in a sequence diagram.

    I'd appreciate it if you can clarify. Maybe sequence diagrams are not appropriate to all web pages.

    Regards,

    James
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2009
    Location
    Hobart, Tasmania
    Posts
    475
    Rep Power
    287
    I assume you've been assigned this task, as there would be no reason to produce a sequence diagram after the implementation. You'd reverse engineer the whole project with a relevantly equipped UML tool and annotate the results.

    As I said earlier ... the primary role of a sequence diagram is to outline the significant steps in some kind of process.

    Whatever is in your code ... is either significant or it is not ... that's a judgment call only you can make. The stuff that is significant should get a mention in your sequence diagrams.

    If your diagram looks confusing or it's particularly difficult to ascertain basic logic flows, etc ... that's probably highlighting an ugly design in the script.

    IMHO if your programming team is less than 10 people or you haven't got a round-trip tool setup (UML to code and back), modeling just adds work.
    Latery Matey
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0
    Can we use class diagrams and/or sequence diagrams if the coding was implemented with the procedural approach?

    I didn't use any classes in my implementation. Therefore I find it confusing since we have always used class diagrams an sequence diagrams with object-oriented code.
  10. #6
  11. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,188
    Rep Power
    2265
    Moved to Software Design from PHP.

    Activity diagrams are essentially simplified cross-functional flow charts. Usually these are used to diagram user/system interaction based on a Use Case; an Activity diagram is usually the first diagram you'll do during your architectural analysis & design, after writing the Use Case and drawing the Use Case diagram.

    Sequence diagrams document system interaction in a more detailed way. These can be way more atomic than Activity diagrams; usually you'll have a one-to-one relationship between use case / activity (usually), whereas you may have a proliferation of Sequence diagrams for each use case.

    Working through drawing Sequence diagrams is a great time to determine where you might find reusable coding opportunities, and is also a great time to start thinking about leveraging design patterns (eg, Factory) to make implementation easier.
    DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Connect with me on LinkedIn
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0
    I appreciate your response. Though my question was, can we use, class diagrams and/or sequence diagrams if the coding was implemented with the procedural approach and not in an object oriented approach?

    Usually we need classes in our code implementation to make use of a class diagram and hence a sequence diagram. Or can we use class diagrams and sequence diagram regardless of the approach in implementation (procedural or object-oriented)?

    So basically would it be suitable to design a class diagram if we will have no classes in the code?

    James
  14. #8
  15. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,188
    Rep Power
    2265
    Originally Posted by JamesGr
    I appreciate your response. Though my question was, can we use, class diagrams and/or sequence diagrams if the coding was implemented with the procedural approach and not in an object oriented approach?

    Usually we need classes in our code implementation to make use of a class diagram and hence a sequence diagram. Or can we use class diagrams and sequence diagram regardless of the approach in implementation (procedural or object-oriented)?

    So basically would it be suitable to design a class diagram if we will have no classes in the code?

    James
    Activity and Sequence diagrams, sure. It would be a little odd to use Class diagrams when you're not using classes, though I suppose they could be used as "list of functions contained in a specific .php file" diagrams (or whatever language you're using)

    Activity diagrams really don't talk at all about technology - sorry if the subtext to my initial response wasn't clear on that. Activity diagrams are just flow charts. It just shows user interaction with "the system". In the same manner that Use Cases don't prescribe technology (that's the architect and developer's responsibility), Activity diagrams and/or cross-function process flow charts don't prescribe technology. They just demonstrate the flow of activity from one step to another, as is outlined in the Use Case.

    In your sequence diagrams you could detail function interaction instead of class interaction.

    Hope that helps.
    DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Connect with me on LinkedIn
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jul 2005
    Location
    Bay Area, California
    Posts
    841
    Rep Power
    1682
    You might find Robustness Diagrams useful prior to constructing sequence diagrams, so that you can sketch out the abstract interactions on the website. If you are familiar with Model-View-Controller (MVC) then the decomposition should feel fairly natural and you can quickly work out an overview. A sequence diagram will then be easier to contruct since you'll have less variables at play. A class diagram won't make sense in a non-OO context, though structured analysis may be useful.
    Core design principles when developing software systems.
    See my open-source project as an example of professional code.
    ---
    The opinions expressed do not represent those of my employer.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2009
    Posts
    5
    Rep Power
    0
    Thanks that clarifies things a lot.

    Though I didn't get the part about the "list of functions contained in a specific .php file". Because each class diagram has the operation compartment. In which class' operation compartment would that function go (since there are no classes and methods of the classes)?

    In your sequence diagrams you could detail function interaction instead of class interaction
    I have never done this for function interaction. I'm use to doing it for object interaction, which seems easier. Is function interaction sequence diagrams a popular method or good choice?

    James
  20. #11
  21. Moderator Emeritus
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Austin, TX
    Posts
    7,188
    Rep Power
    2265
    Originally Posted by JamesGr
    Thanks that clarifies things a lot.

    Though I didn't get the part about the "list of functions contained in a specific .php file". Because each class diagram has the operation compartment. In which class' operation compartment would that function go (since there are no classes and methods of the classes)?



    I have never done this for function interaction. I'm use to doing it for object interaction, which seems easier. Is function interaction sequence diagrams a popular method or good choice?

    James
    Honestly I just thought it up as a solution for leveraging the class diagram for procedural style coding.

    If you're just trying to model website functionality, you might consider doing formal functional decomposition using IDEF. It's a different approach than RUP/UML, but certainly useful. I use IDEF0 and IDEF3 quite a bit.
    DrGroove, Devshed Moderator | New to Devshed? Read the User Guide | Connect with me on LinkedIn
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Originally Posted by l8rm8e
    I assume you've been assigned this task, as there would be no reason to produce a sequence diagram after the implementation.
    What? I'd say most of the UML diagrams I have ever created, documented the As-Built design of the system. It's one of the first things I do when I am assigned to work on an existing product. Most shops allow the code to get out of sink with the design documents (if any) over time and the few that do keep them up to date, spend a lot of time doing As-Built documentation.

    Sequence diagrams are an excellent way of documenting your understanding of how a system works. I have found my customer's are sometimes surprised to discover some of the actual workings of their product (some in contravention to their own documentation). It's a good way of identifying the parasites in an organization. They tend to run from the light or puff themselves up and hiss at it a lot.

    Originally Posted by l8rm8e
    IMHO if your programming team is less than 10 people or you haven't got a round-trip tool setup (UML to code and back), modeling just adds work.
    Modeling is an excellent tool to organize your work plan around. It's also useful for communicating with management and marketing as they tend to understand cartoons better than anything else. I have won multi-million dollar contracts for my employers in the past, simply because I did have a stack of diagrams to show the client that my competitors did not have. If revisions are archived and more-or-less continuous refinements made as new work is discovered, you have an excellent data set for use in your post-mortem report. With this kind of data in hand from previous projects within that domain, you can better justify your budget requests in future projects.


    All that said, I do agree with your basic premise that there can be too much modeling. Figuring out how much is a bit of an art form at the moment, but as we accumulate data, it is evolving into a science.

    Comments on this post

    • NovaX agrees : You're 100% right, and it might even be more valuable as post-development documentation than in the original design phase.
    I no longer wish to be associated with this site.
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Use component diagrams where you don't have support for classes in the implementation language.

    EDIT: Also package diagrams. In your case, you probably have at least two; server side code and client side code, plus any stored procedures and third party code you deploy.
    Last edited by jwdonahue; December 22nd, 2009 at 03:46 PM.
    I no longer wish to be associated with this site.
  26. #14
  27. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2009
    Location
    Hobart, Tasmania
    Posts
    475
    Rep Power
    287
    Originally Posted by jwdonahue
    What? I'd say most of the UML diagrams I have ever created, documented the As-Built design of the system. It's one of the first things I do when I am assigned to work on an existing product. Most shops allow the code to get out of sink with the design documents (if any) over time and the few that do keep them up to date, spend a lot of time doing As-Built documentation.

    Sequence diagrams are an excellent way of documenting your understanding of how a system works. I have found my customer's are sometimes surprised to discover some of the actual workings of their product (some in contravention to their own documentation). It's a good way of identifying the parasites in an organization. They tend to run from the light or puff themselves up and hiss at it a lot.



    Modeling is an excellent tool to organize your work plan around. It's also useful for communicating with management and marketing as they tend to understand cartoons better than anything else. I have won multi-million dollar contracts for my employers in the past, simply because I did have a stack of diagrams to show the client that my competitors did not have. If revisions are archived and more-or-less continuous refinements made as new work is discovered, you have an excellent data set for use in your post-mortem report. With this kind of data in hand from previous projects within that domain, you can better justify your budget requests in future projects.


    All that said, I do agree with your basic premise that there can be too much modeling. Figuring out how much is a bit of an art form at the moment, but as we accumulate data, it is evolving into a science.
    My experiences with programming have been on small to medium sized projects, usually on my own (rarely with a single off-sider). I've only worked in a "team" (as such) on a few occasions, most notably my third year uni project (all those years ago). In my circumstances, I'd only use modeling tools when they offered a round-trip experience ... ie: adding to the solution, not adding extra work (which is a problem when you're alone). I'm a pen/paper junkie ... and tend to sketch out projects on my sand-proof shock-proof unlimited battery life spiral bound notebook (before I touch a computer). This is my poor-mans substitute for UML.

    For any other reason (especially learning someone elses code), I reckon your opinion is spot on and quite educational.

    It's interesting (to me) hearing perspectives from a team member, where these tools obviously take a life of their own.

    Anyone reading this ... ignore my previous comments on the subject ... I shouldn't have been devaluing UML, I should be devaluing self employment.
    Latery Matey
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    May 2004
    Posts
    3,417
    Rep Power
    887
    Originally Posted by l8rm8e
    I'm a pen/paper junkie ... and tend to sketch out projects on my sand-proof shock-proof unlimited battery life spiral bound notebook (before I touch a computer)
    I know many engineers who still keep better lab notes than they do online documentation. I have had to impound such things, when they were worth the effort; and have them scanned and added to the archives as the baseline documentation from which we would go on to construct adequate as-builts. I have two basic issues with the spiral notebook approach; it's not online and it usually isn't written for anyone but the author to comprehend.

    Adoption of modeling tools and other online documentation only solves the first of those issues. Resolving the second of those issues requires changes in motivation and attitudes. In your case, that might not ever be needed, but I'd be willing to bet you have encountered cases where you had some explaining to do and there seemed to be an impedance mismatch when you did have an audience other than yourself. Even if you rarely do have another audience to contend with; documenting as-if you did can actually improve the way you think about some problems. You don't necessarily have to bring it to a level of self-evidence to anyone with elementary skills, but if you write for another audience; then if you do encounter that need, you'll only have to make incremental changes and not have to start from scratch. In fact, you can start with what you have to determine the level of detail that will be required to get the point across. That's harder to do with a notebook full of hand written notes, some of which you may never want anyone to see.

    EDIT: I would love to have adequate round-trip modeling tools. With the exception of domain specific tools, I never found such a thing and I have tried some very expensive tools over the years. My problem is the domains I work in have been too varied for one tool to deal with. I work on Windows a lot so Visio, Word and Excel are my favorite tools for modeling and documentation. Visio is particularly useful for basic analysis modeling and for a lot of the projects I have worked on, that's most of the diagramming that got done until we had a stable enough design and prototypes to start working on as-builts.

    The level of detail required depends on the total complexity of the system being developed.
    Last edited by jwdonahue; December 23rd, 2009 at 06:26 PM.
    I no longer wish to be associated with this site.
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo