开发者

Is there any site/resource/book to practice and solve OO-design related problems?

Looking for some reference material where i can get some OO designing problems and solution to practice and improve designing skills.

Thanks for your interest.

EDIT: I have read: - Re开发者_JAVA技巧factoring by Martin Fowler - Headfirst Design Patterns (It had problem-solution approach but very limited to a pattern in context). and have fare idea about common design patterns.

I am looking for a reference which is very specific to design related problems and solutions.


I think that this is a really interesting question. As has been pointed out there are many good references on useful design patterns, OO principles and other techniques.

I've not yet seen resources that allow someone to exercise the application of these techniques. As someone with a background in education I've thought about this kind of resources and my conclusion is that developing useful resoruces is extremely demanding. It's not that hard to come up with little questions that "bake" an answer (eg. devise a problem that might be addressed by using an Abstract Factory) but those are trivial problems, the real art comes when the systems are bigger and there are trade-offs to be considered; where there may more than one "right" answer.

I can imagine that high quality formal course might contain such material, but finding something free? If we can find some that would be really nice.

I suspect that at present you may need to rely on mentoring, learnng on the job, and lengthy experience.

Perhaps one thing to try: Buoild your own material! For example, take a non-trivial problem in a Domain with which you are familiar and try to devise a solution. As you progress post questions about small pieces of design here (or perhaps a more discursive site). Going to be tricky to keep the questions small and foscused. But I think the major thing you need is feedback and collaboration.


Project Euler gets mentioned from time to time. It's a site with 200 "puzzles" you can use to practice OO design and coding. You can practice any coding language or methodology too.

Here's a list including other sites that give you problems to practice coding skills: http://grok-code.com/214/practice-your-code-fu-programming-contests-and-puzzles-online/


Maybe I'm a little OT, but since your question would require a quite broad answer I suggest you to get familiar with books/sites about "patterns".

Shortly, patterns are standardized solutions to common OO design problems (you shouldn't "reinvent the wheel").

The first and, IMO, most read one is "Design Patterns: Elements of Reusable Object-Oriented Software". It's from 1994 with examples in C++ and Smalltalk, but its approach is usable with every OO language.


Try "Domain Driven Design" (or DDD), which defined design patterns to use in object-oriented programming. Eric Evans is the author that started it all. Martin Fowler is another one that has Enterprise Design Patterns http://martinfowler.com/articles/enterprisePatterns.html. They are both a huge influence on design patterns. Design patterns are the common ways to setup your code and solve object-oriented programming problems.

Hope that is the type of thing you're looking for. Good luck!


Well, GoF is a classic and a good start.


I liked Applying Domain-Driven Design and Patterns by Jimmy Nilsson. The material is good and the writing is conversational.


When you code and have some problem, try to think of a design pattern that can be applied in this situation.

For example: you need to use a third-party API in a project (say, Mailgun API).

What problems are there about that and how can we solve them?

The problems are:

  • we may want to replace Mailgun's API with some other API
  • our code depends on a vendor if we use the code for out API directly

So, a good soultion is the Adapter design pattern.

By the way, I've created a video with 12 examples of the Adapter pattern and you can see object-oriented design in practice in it:

https://youtu.be/q5520HhjVLk

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜