Jump to content
  • Advertisement
Sign in to follow this  
Darkneon

Unity Help Choosing The Correct UML Diagram (Beginner) -- After

This topic is 4736 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This is a continuation from this thread Help Choosing The Correct UML Diagram (Beginner) . It seems like I cannot reply to it; it always send me to the first page when I try. Now that I'm done with my project, I have the following to say (long!). Fastlane69 you were right, I did blow off my leg! I started with the Use-case and the Sequence Diagrams. I really liked doing them because they helped me with emphasing on the clients' requirements and also depicting how the finished program "is going to" operate. They did blow up in my face though--more on this later. Then came the Class Diagram, and man that was a though cookie. At first, I started to think about all the classes that I would need, and how I would connect them together. I ended up with 3 base classes: 1 with 2 subclasses and another one with 3. Then came the nightmare, I couldn't connect them. I mean, could not reproduce the flow of my Sequence Diagram. I spent two days trying to fix it by either adding more classes or functions that would handle the other classes. Fed up, I took a two days break playing Megaman Zero 3. And one morning, while in the bus, it just "clicked". Literally, the clouds moved away and the solution appeared in front of me. I had too many classes... and after droping them one by one (it was a lot of fun actually), I was left with 1 class and 3 subclasses. I also reslized that my Sequence Diagram was poorly designed in the first place, hence all the trouble. Lesson #1 : The less classes the better.
Quote:
Until you actually sit down and code out the project, you're not going to really be aware of all the little nuances.
So TRUE Clash. I got my confidance back because I though I had a good design (for my first try at least). But that saying put me back to reality real fast. All the nuances started to pop up one after another. I guess I was too focused on the high level stuff and when I got to the low level, the design was no help at all. The worst is, and I am sure of it, that some of them I would have been able to predict. For example, in one function, I was outputting and formating the result directly to a textbox. To realize that I would need that value later on. Sure, the solution is easy--return the value. But when the value is 10$ and you only need the 10, and you cannot change the value of the textbox, it's a pain. Time and effort lost! Lesson #2 : Never think your design is completed. So that's it. Although I wasted a lot of time, I did finish the project on time. I also have to say that Clash your post is very demotivating. I have read it at least 20 times and don't see anything positive. I didn't want to believe it back then, but your right. Now, that TDD seems interesting. I didn't look to much into it. It would be cool if you could elaborate on it. Darkneon

Share this post


Link to post
Share on other sites
Advertisement
Quote:
I also have to say that Clash your post is very demotivating. I have read it at least 20 times and don't see anything positive. I didn't want to believe it back then, but your right.
I used to think that becoming a better system architect meant that I would have to redo less. That as I got better my first designs would be closer and closer to perfect. At some point I realized that was simply impossible. There are lots of reasons why, both political and technical. All the fuss going on about "Agile Development" isn't just hype. The fundamental idea is all about writing code earlier in a project. Writing that code in such a way that there are no extra features and it is easy to refactor.

I suggest you read up a bit on Agile methodologies. In particular, I think XP has a lot of good ideas (one of which is Test-Driven Development). Take a look at these two books:

Extreme Programming Explained:
http://www.amazon.com/exec/obidos/tg/detail/-/0321278658/qid=1117592351/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/002-0279005-5628819?v=glance&s=books&n=507846

Test-Driven Development:
http://www.amazon.com/exec/obidos/tg/detail/-/0321146530/qid=1117592335/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/002-0279005-5628819?v=glance&s=books&n=507846

Share this post


Link to post
Share on other sites
I second that motion. I find that the people that think Agile is a buzzword are the people that aren't willing to give up their old school way of developing software and are just dead set in doing things the HARD LONG way.

Agile, at its core, is a methodology that is Human-Based...ie it starts with the correct belief that you will NOT get something right the first time but through careful iteration, you will get something that was better!! This is in sharp contrast to the old school developers that is Computer-Based and who think that their first pass at code should be 99% correct and keep wondering "why doesn't that last 1% work? It should work!" and keep trying to pound a square peg into a circular hole :} LOL

Beside, Agile complements UMLs fantastically since drawing is a much more expresive and efficient way to communicate large complex ideas (all too common is soft dev).

Remember your two lessons, they will take you far. Especially with UML, it is easy to see when you are overwhelming your system and I suspect this will NOT be the first time that you will look at a UML diagram and have a eureka moment by merely subtracting one class...try to do that with procedural, non-iterative programming!!!!

Share this post


Link to post
Share on other sites
Quote:
Original post by Darkneon
Lesson #1 : The less classes the better.

This is somewhat wrong. A good design has the correct number of classes. This class count can be rather big. Using some OO programming principle might increase the class count (for instance, if you choose to follow the 'favor composition over inheritance' principle, you'll probably end up with a large amount of small object. This is not bad at all, since most of these objects will have a clearly defined interface and will be easily reusable).

Quote:
Original post by Darkneon
Lesson #2 : Never think your design is completed.

... but you'll have to stop it one day, because if you don't then you won't be able to finish your product :)
Perfection doesn't exist, but you may consider that your design is finished whe it is "good enoug". Remember we speak about software engineering in this forum, and engineers tend to have things to create - just thinking about something is not sufficient.

Quote:
Original post by Darkneon
So that's it. Although I wasted a lot of time, I did finish the project on time.

Then it is good! It should be interresting for the community to share your experience about this first use of UML.

Regards,

Share this post


Link to post
Share on other sites
Thanks guys for posting. I will first answer to Emmanuel Deloget comments.

First Comment: OK, I can't comment anything right or wrong on this one! I can't because I don't have enough knowledge at the moment. But I don't discard what you said, I'll just put it in my bag until reality proves me right or wrong. As a side note, I have read it somewhere (can't remember where) where the person was suggesting to put only the important classes in the diagram and to indicate that the other classes exist without including them.

Second Comment: Sure, it's like the saying that "perfectionists never finish anything", which I personally totally disagreed with. But that's not the point, the point is what Clash mentioned before "[that] until you actually start making the API calls and writing the functions, you can't know if your design is correct". Now, replace 'correct' with my 'completed'. Plus, I'll say that it's not when you start off writing the code that you'll catch a problem with you design. You can write out 3/4 of the program and realize that the rest is off or something is missing. That's why from now on I am going to go back and forth between my programs and designs.

Furthermore, I started reading "Test-Driven Development By Examples" and I am also reading articles by Martin Fowler.

I have a question about TDD. Lets say that my primary goal it to save time. Is using TDD going in the opposit direction? I mean if you test every 3 minutes, even if it is for 30 seconds, at the end of the week that's a lot of hours lost. It has become an habit since I started programming, and I found it to be the most time consuming part. Or is it an "in the long-run" thing?

Thanks
Darkneon



Share this post


Link to post
Share on other sites
Quote:
Original post by Darkneon
Furthermore, I started reading "Test-Driven Development By Examples" and I am also reading articles by Martin Fowler.

I have a question about TDD. Lets say that my primary goal it to save time. Is using TDD going in the opposit direction? I mean if you test every 3 minutes, even if it is for 30 seconds, at the end of the week that's a lot of hours lost. It has become an habit since I started programming, and I found it to be the most time consuming part. Or is it an "in the long-run" thing?
It's definetly something that doesn't pay off until the end of the project. You can test now, when the code is fresh in your mind and fixes are blatantly obvious, or you can test later, when you'll have to spend more time remembering what the code does, and then fixing it. Unit testing is orders of magnitude easier and more productive than intergration testing.

It also (at least for me) is huge morale booster. There are few things better than seeing all of your tests pass.

Whether it reduces development time is irrelevant to TDD - it's all about increasing the quality of the code. It usually taking the same amount of time as "traditional" testing methods, but produces much cleaner code. It's also a great way to debug designs - when you're writing your tests, the design's flaws are more apparent than when writing the actual code.

Share this post


Link to post
Share on other sites
When you first start doing test-driven design your productivity will drop for a while as you get accustomed to it. After a few months your productivity will end up higher than it was when you started. Why? Well... aside from having better designed code, TDD essentially automates your debugging process. Rather than having to step through the code and place print statements everywhere, you automate the checks. This lets you recheck the entire application without doing anything. You'll see the benefit to this everytime you add any non-trivial feature. It'll be immediately known if something else broke.

Of course this assumes that your tests have good coverage. But if you find a bug that doesn't cause a test to fail; write the test so it fails and then fix the bug.

The unit tests also serve as good sample-code for the code being tested.

Share this post


Link to post
Share on other sites
Quote:
Original post by Darkneon
Furthermore, I started reading "Test-Driven Development By Examples" and I am also reading articles by Martin Fowler.

I have a question about TDD. Lets say that my primary goal it to save time. Is using TDD going in the opposit direction? I mean if you test every 3 minutes, even if it is for 30 seconds, at the end of the week that's a lot of hours lost. It has become an habit since I started programming, and I found it to be the most time consuming part. Or is it an "in the long-run" thing?

Thanks
Darkneon

Lost? How so? Consider this, the longer you wait between running tests, the more debugging you end up having to do to fix the bugs that cropped up because you didn't run the tests. Secondly, the loss of time is an illusion. While it does appear that you are spending more time coding tests and running them, in fact you will generally find (in the long run with experience, and in the short run afterwards) that not only does it consume less time than traditional "wait till the very end then fix all the fuckups" method of coding, but it also enables you to quickly make changes and verify that they don't fuck up anything else.

Refactoring is a core principle of XP, along with TDD. I would definantly recommend picking up the book by the same title. Refactoring also relies on unit tests, mind you. Which means that if you have already coded in the tests, then you've saved yourself from having to code in the tests on code that "works". The advantage here is one of perspective. Rarely will you be able to think through and complete cover the workings of "working" code. However if you write the tests as you develop the code, then your coverage will be more complete.

Also, a test that passes, but should fail is often more informative than a test that should pass but fails.

Finally, in parting, I have this link for you: JustTenMinutesWithoutAtest

Share this post


Link to post
Share on other sites
I'm getting confused here.

Quote:
TDD essentially automates your debugging process. Rather than having to step through the code and place print statements everywhere, you automate the checks.

What do you mean by 'automates your debugging' and 'automates your checks'?

Quote:
Which means that if you have already coded in the tests, then you've saved yourself from having to code in the tests on code that "works".

Let me try to rephrase it. If you have code that has been tested and debugged, now that it works, you don't have to modify it anymore? But working code is not shielded from future code.

Quote:
However if you write the tests as you develop the code, then your coverage will be more complete.

You will be able to spot stuff that otherwise you would have missed. The questions: "I need to write a function that will ..." and "I need to test a function for ..." lead to different answers even though they imply (more or less) the same thing.

Good link by the way.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
  • Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By Hive Entertainment
      I have already chosen my favorite from the concept artist which one do you like better 1 2 or 3?
       
      Also still looking for a writer and a 3d artist message if you are interested!

    • By Armaan Gupta
      Hey There,
      I am a developer and Im working on a blockchain based infinite runner type game. Right now, I am working on releasing the beta version with a couple other game developers, but would love to expand the team and have other talented and bright people contributing. The game portion of the project isnt very complicated, and wouldnt require anyone to pull thier hair out for it.
      If you are interested in joining a project, interested in the idea, or would like some more information, please don't hesitate to ask either by commenting, discord (username: Guppy#7625), or by email (armaangupta01@gmail.com).
      Thank you!
    • By Joydeep Mani
      I am trying to build a particle system for unity based on "Destiny particle architecture " released in Siggraph.
      I encounter a problem in trying to understand how they iterated this:

      Converted to spline function and the result is

      i wanted to know how did they converted the function in the editor to represent the graph ??
       
    • By Xerath Dragons
      This is my first experiment use for create my original character little cute dragon chibi use zbrush and blender and use unity3d assest free for enviroment scene you have feedback?
       


    • By Aryndon
      Project Redemption is an semi-fantasy RPG with a linear story and an elaborate combat system.
      We are building in Unity and are currently looking animators and artists.
      What we are looking for
      -Someone who is okay with split revenue/profits when finished
      -Collaborate with others in the team. Do you have an idea/thought on what should be included? Tell us!
      -Someone who wants to work with people that are passionate about this project
      If you are interested. Please message me and I will get back to you as soon as possible! Or add me on Discord AJ#6664
    • By Aggrojag
      Hello!
      I'm working on a game that is a narrative driven dark comedy with some small aspects of platforming and puzzle solving. The project is rather small as well. It touches on topics such as suicide, mental illness, family, corruption, free-will, and redemption.
      This project is exercise in polish, this means some experimentation will be needed along with some reworking of assets as they're provided.
      This will be a revshare model.
      First, I'm looking for a 2D sprite artist, not pixelated, that can compliment the style of the attached images, and be similar to the temporary character.
      We are looking to bring on a SFX designer at this time. Full list of required SFX will be available upon request, as well as a build with all elements related to sound implemented in some form (many SFXs pulled from the web for now). Will likely require some field recording, and some pretty strange SFX for when things get weird. I imagine a good portion of these will be quite fun to create.
      Lastly, I'm looking for a male voice actor, English should be your primary language. There will be at minimum two characters that will need to be brought to life through vocals. The first voice is similar to Marvin from Hitchhiker's Guide to the Galaxy. A reference for the second voice would be a mix of Ren (Ren & Stimpy), and Android 21 (DragonBallFighterZ). Due to formatting, I'm not including YouTube links in the post, sorry.
       
      WIP Scene with our custom shaders attached (platforms are lazily placed, as this was an asset test):

      A scene with dynamic lighting and temp character:

       
      Unshaded asset:

      If you made it to the bottom, thank you, and I look forward to hearing from you.
    • By SickTwistGames
      Ok, firstly, Hi.
       
      This is my first post on this forum. I am an Indie Dev making my first game so bear with me when I say dumb stuff, I'm on a huge learning curve.
       
      My first question is about inventory systems for unity. I am trying to make a survival type game with crafting. I have purchased Inventory manager pro by devdog from the unity asset store and it seems like a pretty powerful assett but for an intermediate coder its a little tough to use.  I'm beginning to wonder if it was the right purchase.
      So my question is.... does anyone have any experience of inventory plugins / systems for unity and can anyone reccomend a system to me?
      It needs to have the following: Loot system, crafting system, character sheet, blueprint system,  character stats system. Ideally with as little coding as possible.
       
      Thanks
    • By ethancodes
      I've got a bug with my brick breaker style game. The bricks move down one line at a time ever 1.5 seconds. What appears to be happening is occasionally the ball will be just about to hit the brick when the brick moves down a line, and now the ball is behind it. I'm not sure how to fix this. I have two ideas but I'm not sure of implementation. 1 solution would be to check where they were and where they are going to be before rendering the frame. Then if they crossed paths, then register the brick as hit. Solution 2 would be change how the bricks move. I could maybe slide them down line by line, instead of a jump down. I'm not sure of this will fix the issue or not. Any ideas?
    • By Pixeye
      I wrote an extension for unity inspector that allows to group/fold variables. 
      Available on github  , cheers!

       
    • By rakshit Rao
      I'M interested in programming tools (For animation, UI, etc). Can anyone suggest me the resources where I can start learning or which technologies I need achive it.
       
      Thanks,
      Rakshit
  • Forum Statistics

    • Total Topics
      631070
    • Total Posts
      2997746
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!