开发者

How to learn designing applications in Java [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

I have been programming in Java for the past 2 years and now i want to get into Designing applications. So far i am only into coding ie; i am given design document/class diagram etc and asked to code. Now i want to learn how to design, i mean i want to lean when should a class be interface not a concrete class, coming up with design given the requirements , design techniqies and all the other aspects of desiging.

To learn all these could you plese suggest any series of articles/books etc.

I have tried reading Headfirst Design Patterns, but even though i am able to grasp few design patterns, i am still not able to get on to the desigin开发者_如何学Cg apllications on my own.

Please help.


Design Patterns are quite advanced examples of design features built on fundamental principles such a Separation of Concerns, Coherence and Extensibility. If you are at the stage of wondering about Interfaces and Classes you may need to do some reading about fundamental OO ideas. For example read about SOLID principles. So I would not fisrt buy a book, I would start at that article and follow links and googles from there.

Then, reading is not enough, you need to do.

Next time you get a spec, study it. Understand the problem that is being solved, then go home and design it yourself. Compare your attempt with the spec. Or consider alternatives to the spec you are given, suppose you didn't have an interface here, or a Factory there why would this matter?

Ideally, your growth would be enabled if you leaders would start to give you less specified problems and allow you to design them. Project pressures may prevent that. In which case I think you need to do work in your own time. Pick some small projects and work on them. This may be tough unless you have mentors, but I think reading without doing is not going to advance you so quickly.


This is a common question, and I don't blame you for asking it! It's something that we all ponder. You may find this question, and the associated answers, useful: Learning/Implementing Design Patterns (For Newbies)


You might read Effective Java by Josh Bloch.

Design patterns are good, definitely read up about them, but it is knowing when to use them that is the real skill. Mostly you need to get your hands dirty.

A mediocre coder will be given a task, bang on the keyboard until they have something that works, and move on. Occasionally just getting something working is the right thing to do, but often a coder like this leaves a swath of horrible code in their wake.

You can learn an enormous amount from taking a more academic approach. Write some code, get it working, then improve it. Rewrite it from scratch reusing what you have learned writing it the first time. Spend extra time looking at what you can improve regarding all aspects of the code: speed, memory, algorithms, design patterns, even your coding style.


For the beginning try this:

  1. Read a paragraph about 1 design pattern (as they listed in the book).
  2. Try to understand the problem it solves.
  3. Imagine some task with this problem.
  4. Code it.
  5. Draw a class diagram of your program on a piece of paper (without automated tools).

One pattern per day will be a very good velocity.


The only way to improve is to read design patterns, try stuff, learn from mistakes, and get advice from people who have some of this experience already. Another thing is you should know when not to use patterns also. some times we overlook by design patterns and it spoils the project.


I agree with Ben, and would like to add my 2 bobs worth...

Design is an art, and like painting it doesn't come from books, it comes from inside.

Concepts like Design Patterns are not the alpha and omega of design, they are part of the toolkit used to create a design. Design Patterns in particular give us a vocabulary for describing approaches to solving some common problems. However identifying the problems to solve is part of the art of creating a design from requirements.

Have a look at the requirements that relate to the design documents you receive to code with. Think about the way that the designers have broken the requirements down into a series of finite problems to solve.

And of course, don't be afraid to ask your designers about their approach.


Best way to learn something is to learn by doing and learning from other real world projects.

Learning design patterns is essential to design good applications but that alone will not be sufficient. Apart from books/reading/examples I recommend going through the design of existing applications. Choose an Open source project - explore, experiment and contribute to the project. While contributing learn about the design principles and methods used in the project. Don't be afraid to try multiple projects until you find the "one" which excites you the most.

Ofcourse initially you will need theoretical knowledge to begin with, so I recommend the following book:

  • Applying UML & Patterns by Larman


Designing applications takes a bit of practice, but that shouldn't stop you from trying. After a while, you'll get the hang of it;

A tip: Try to learn from your colleagues. Let them show you how they design applications, what process do they follow, how do they identify problems and do they use patterns to solve them? Sometimes it's best to see how the design process works instead of trying do learn it all by yourself.

My 50 cents on good resources:

  1. SourceMaking Design Patterns

  2. Video course on design patterns

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜