문제

I don't want to say that is not necessary knowing design patterns. I just want to tell you my experience.

I've used Spring frameworks for four years and another frameworks (JSF, Mybatis, Hibernate, etc) in various projects where I've participated (I work as Java Developer). In all this time, I've used few design patterns. Knowing Design patterns haven't been necessary for building medium and inclusive large java web applications.

It's a few shameful saying that I only have used MVC, DAO and Factory patterns. Maybe, other two more...but I don't remember

I'm awareness that It's no good and I should improve (I'm trying to learn more about design patterns).

Firstly, I would like if someone has had the same experience that me. Secondly, if could you give information about Use of design patterns with frameworks Java (This is because is almost impossible I leave to use Java frameworks but I know I need to use design patterns for good practice).

도움이 되었습니까?

해결책

Most frameworks already use a lot of known software design patterns. So you are using design patterns unknowingly.

That said, I would strongly suggest you to try learning at least the most common ones. It's funny.

In the other hand, in a framework, your classes "fall into place" within the design of the framework, but you have to code your business logic anyways. And, in that scope, design patterns do still apply. Patterns do not only apply at an "architechtural" level but also at the level of business logic. Chances are parts of your domain classes or controlers have to solve problems that benefit from some design patterns. The so called behavioral design patterns are most likely to be used in business logic, since most frameworks already take care of the creational and structural aspects.

So the bottomline would be, no. Working mostly with frameworks doesn't mean you can no longer benefit from knowing design patterns. And, as I said before, they are fun to learn and use. To my opinion.

다른 팁

Remember, the original GoF book has the full title "Design Patterns. Elements of Reusable Object-Oriented Software.".

And most of the GoF patterns have that purpose - build software which can be put into libraries and/or frameworks and reused in a wide range of use cases, in a black-box manner, mostly following the open-closed principle.

So if one is not building any reusable software, just relying on frameworks developed by others, it is perfectly possible never to find the need to implement any of the GoF patterns by themselves. On the other hand, I am pretty sure inside any general purpose framework like Spring one can find 90% of all GoF patterns applied somewhere.

So my recommendation is - learn more about design patterns if you want to improve the design of your components to make them more reusable. If that is not what you want (which would be perfectly ok, I am not rating this), you probably do not need to learn much about those pattern.

I suggest you not focus on frameworks and then focus what design patterns are. I suggest you start reading Head First Design Patterns and learn those patterns.

Then you should think about how to work with frameworks while using those patterns.

Good Luck!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 softwareengineering.stackexchange
scroll top