Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Are You Afraid : Knowing Your Frameworks Well

DZone's Guide to

Are You Afraid : Knowing Your Frameworks Well

· Java Zone ·
Free Resource

Download Microservices for Java Developers: A hands-on introduction to frameworks and containers. Brought to you in partnership with Red Hat.

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.

Download Building Reactive Microservices in Java: Asynchronous and Event-Based Application Design. Brought to you in partnership with Red Hat

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

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

{{ parent.tldr }}

{{ parent.urlSource.name }}