Over a million developers have joined DZone.

Are You Afraid : Knowing Your Frameworks Well

· Java Zone

Learn more about Kotlin, a new programming language designed to solve problems that software developers face every day brought to you in partnership with JetBrains.

The last two weeks I've been simplifying an application flow engine based on Apache Struts 1 - I know it's an old technology but I don't care, I have a job to do ;-)

Anyway I discovered a lot of strange use cases where some custom mechanism was built instead of using what was already provided with the framework. It was like inventing a wheel once again! Frankly, I was truly surprised how someone could do this that way. And I start thinking what was the reason they did that...

The only thought that came to my mind was that someone was afraid to use what was already provided with Apache Struts 1 - he didn't know the framework well, was too lazy to check sources, and so on. I was really devastated! If someone was doing an application in such a way, no framework will help him or do the job for him!

Recently I've been solving issues in Apache Struts 2 and one of them was to add wildcard support to a file upload mechanism. I provided a patch that solved that problem with some homemade RegExp engine. I just added a test case to prove it was working properly and committed all the changes to a source code repository. After that a more experienced committer pointed out that I should use the existing PatternMatcher class instead, which I did and the code looks much better right now. You can see an example here Apache Struts 2 useful beans.

The Java Zone is brought to you in partnership with JetBrains.  Discover how powerful static code analysis and ergonomic design make development not only productive but also an enjoyable experience.


Published at DZone with permission of Lukasz Lenart .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}