   UML or not UML?
  Greeting everyone,Right off the bat, I m a lazy coder, I hate doing the same thing over and over again. I ve been dreaming of getting help for repetitive things like building classes, adding variables and accessors, making sure everything is well aligned, functions and variables being alphabetically sorted and especially phobias like making sure there is no empty tabs or white spaces across the code.I recently heard whispers on the UML concept, so I’m not sure how this works exactly but I’m wondering if anyone would share their experience, if it worth doing the jump or anything regarding pros and cons from doing so.Thx.   
  UML is about expressing development products (classes, use cases, whatever). It's not a code-generation mechanism. While the language, being reasonably-well-specified, could be used to generate skeletal code structures, this won't actually save you an appreciable amount of effort.I have not found UML particularly useful even within its intended domain. Very few people I've worked with know it (which means its useless as a common descriptive language) and those who do tend to find its stark nature off-putting and find better results in more traditional forms of systems description -- i.e., things that involve actual words.YMMV, but I feel comfortable asserting that you will find UML a complete waste of time and indeed completely inappropriate for what you are asking for specifically here. Think about trying to put a nail in your wall using a hammer made of Jell-O.   ;  GreetingsI would not necessarily completely agree with jpetrie. From my hand side, I know a lot of people able to create and use UML diagrams. And to say it is a complete waste of time is too harsh. Trying to ONLY USE UML is a waste of time, because full modelling haven't solved many problems up to now. But UML (or also other descriptive modelling languages) may help to express some things.First of all, UML is not directly a concept but, as the name suggests, a Unified Modelling Language. By that the language contains a set of diagrams to express specific things like the most often used Class Diagram, Object Diagram, Activity Diagram, State Diagram, Use Case Diagrams etc etc etc. Each of these diagrams is more or less strictly defined (depends on what specification and/or writer you look at). Each has a mere distinct meaning what to express.Now, how you use these models further on is purely your own thing. You can model a whole set of classes and package and convert/generate the stub code from these. Or you can model databases as a class diagram and generate you schema from it. There are many conversion tools out there that try to suggest the Model-driven Software Development MDSD way. These help to convert from and to, mostly off class diagrams. But there are also examples of using State or Activity diagrams to express information or process flows.Me myself, I am not the single biggest fan of a complete MDSD but I like some models to express meanings not only to other peoples but to share as general models between software. You generally could model a whole program/system but would have to rely on your own conversion systems to express the very general models the way you want. But mixtures of Class with Activity and State diagrams to express code, process and data flow is not that uncommon in some areas. Other models like e.g. Petri-nets may also help. So practically you could comprehend a general model-set and generate this all again each time you start something, maybe with minor changes. But someone could say, you could write that code once and store it as basic stub somewhere else. And both ways can be right. You wrote that you are a lazy coder. If you want to use models and conversions you would have to become an enthusiastic modeller, otherwise this won't work. So there are good and bad things.To give one example how I used diagrams in one case: I had an adventure engine running which was completely based on configuration and models. Each dependency, each scene, each action could be expressed by State and Activity Diagrams. These were converted to rules and the according data. Took me much time to write the conversion code and express everything like I wanted, hated that. But it was very flexible and usable for different needs, loved that. I hope this helps as "decision maker".Regards   ;  UML allows you to describe an OOP design.Since OOP is not always the best way to design a software architecture, it's only useful for those parts where you know OOP is the right answer.Since I personally think OOP is crap for virtually everything, I don't recommend to use UML at all.I understand however that in the mind of many people of the profession OOP is the holy grail and that everything should use it.The choice is up to you.Quote:i.e., things that involve actual words.That is indeed the best way to specify things.   ;  thx for your inputs, I was hoping to find in UML a way to build a class template... and a class would be generated/formatted in a customized way in a .cpp and a .h whenever I need it... add guide lines for headers, includes, the way comments are integrated… using a drop down menu, I would be able to add variables to a class... a dialogue would appear with the variable s attributes like type, name, value and more... add parameters and return value to a function. select your function and press edit... Sort function in an alphabetical order, those kind of thing so you won’t have to go in your code but only to type in code logic. Most important, when editing a template every single file in your project could be updated and get the template properties… I m not sure if that has been developed yet but I surely think it would be marvelous… at least for me.   ;Quote:thx for your inputs,I was hoping to find in UML a way to build a class template... and a class would be generated/formatted in a customized way in a .cpp and a .h whenever I need it... add guide lines for headers, includes, the way comments are integrated… using a drop down menu, I would be able to add variables to a class... a dialogue would appear with the variable s attributes like type, name, value and more... add parameters and return value to a function. select your function and press edit... Sort function in an alphabetical order, those kind of thing so you won’t have to go in your code but only to type in code logic. Most important, when editing a template every single file in your project could be updated and get the template properties… I m not sure if that has been developed yet but I surely think it would be marvelous… at least for me.This is not what UML is.Tools like that exist -- VC6 had one for MFC classes for example. But they're not actually as useful as you want to believe.Most IDEs support macroing or add-in capabilities that can be used to generate comments and documentation and the like, and as for generating actual code -- these kinds of tools can only generate boilerplate skeleton code, unless they are heavily customized to generating code in a specific domain (like the VC6 tool, which was designed to reduce friction involved in generating all the MFC message mapping cruft, et cetera). That boilerplate code, when not specialized, consists of a very small amount of lines and tokens, so much so that it's far more efficient for any competent typist to simply type the code.   ;  Although UML can be used to generate skeleton code (and many UML editors export Java/C++/etc code from UML class diagrams), for the tasks you mention you don't need and won't get much help from UML (or any modeling language). I'm surprised that your IDE does not support these tasks, as most of them should be part of any recent half-decent IDE. I know from working with Eclipse that most of these refactoring and source-organization tasks are only a few clicks/screens away. For instance, if I type in a new class member, I can right-click and go "Source->Generate Getters and Setters". There's also "Correct Indentation", "Format", "Organize Imports", and many more. Or let's say I write a method, then I want to change it, I can go to "Refactor->Change Method Signature" and I will get a dialog where I can add parameters or change the return type, etc. Or I can rename a member or method, and it will rename them in all code that calls them.   ;  My thing with UML is that I'm a visual thinker, and it helps me if I can graphically lay out my design, or even just doodle one to get the juices flowing. But that's all I use it for. I don't even follow any strict rules about the exact symbols most of the time. [smile] It's just a way of thinking on paper.   ;Quote: I know from working with Eclipse that most of these refactoring and source-organization tasks are only a few clicks/screens away. For instance, if I type in a new class member, I can right-click and go "Source->Generate Getters and Setters". There's also "Correct Indentation", "Format", "Organize Imports", and many more. Or let's say I write a method, then I want to change it, I can go to "Refactor->Change Method Signature" and I will get a dialog where I can add parameters or change the return type, etc. Or I can rename a member or method, and it will rename them in all code that calls them. I like that, anyone is aware if this kind of operations can be done with Visual Studio 2008/Plug-in? ;Quote:Original post by jpetrieUML is about expressing development products (classes, use cases, whatever). It's not a code-generation mechanism. While the language, being reasonably-well-specified, could be used to generate skeletal code structures, this won't actually save you an appreciable amount of effort.That's false.It is possible to compile UML into C++ (or java or whatever).In fact, it is possible to program games in UML. There is a docmuent that explain it. It is called "Gameon 2008 - MDGD - 2D Platform Game Prototyping.pdf"If you look for it on the net, the link is broken.How can I upload it here? Does this forum support attached files?Well, I put a rapidshare link.http://rapidshare.com/files/233020662/Gameon_2008_-_MDGD_-_2D_Platform_Game_Prototyping.pdf.html