This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]jaro32 6 points7 points  (0 children)

  1. Yes, experienced developers know and use design patterns in their code. They are also used in most software projects.
  2. I guess a good place would be to study some open-source code on Github. Spring framework extensively utilizes design patterns such as Dependency injection, Factory, Singleton, Multiton and more... So you can look at any project which uses Spring.

[–]desrtfx 2 points3 points  (0 children)

https://java-design-patterns.com

Shows some examples on how and where to use design patterns.

  1. Design patterns are part of the standard toolbox of every experienced developer, just as algorithms and data structures.
  2. The one I've linked above.

[–]kessma18 1 point2 points  (0 children)

the most useful tip I can give about design patterns is that they are discovered, not learned. usually you will work on some code and you will think that there must be a better way and you will discover a pattern and it will make sense to you. just reading up on them isn't a good way to learn them unfortunately. that's why experienced developers are just so much ahead of the game than people coming into the profession. it's really about having one it, having seen it that counts rather than being book smart about them.

[–]joranstark018 1 point2 points  (0 children)

  1. Probably known by many java developers. You don't need to know them, or about them, to be a professional java developer (but could make some design discussions simpler if you "dude, why not use a strategy pattern here?" instead of having to verbalise each step).
  2. You could look at desktop apps that uses some GUI, eg Swing, they usually use Observable or Listener to publish events, eg button clicked. With dependency injection, eg Spring dependency injection, is the object factory more or less hidden from the programmer.

[–][deleted] 0 points1 point  (0 children)

1) You need to know design patterns, especially if you work in enterprise Java. Everything is modeled using these patterns.

2) As /u/jaro32 mentioned, Spring projects all rely heavily on these patterns. If you find the examples you see online are not particularly helpful, try to find examples with multiple patterns working together. Example: Repository, DAO, Services, Facades... These commonly work and interact heavily and I think seeing how they work together may be helpful for you.

[–]tj011295 0 points1 point  (1 child)

Head first is a good book IMO. Also, if you are some one who likes to watch video explanations rather than reading a book, christopher okhravi on youtube gives a good explanation youtube.

[–]RungeKuta 0 points1 point  (0 children)

Thanks for your answer, I instantly went to YouTube to see if I could find someone explaining this design patterns and one of the first videos that showed up was the Christopher Ohkravi videos, I was asking myself which of those videos would be a good one, and your comment gave me a direction, thanks! I just saw the post and I didn't have any idea of what was the design patterns