Showing posts with label dependency. Show all posts
Showing posts with label dependency. Show all posts

July 12, 2012

My first component uploaded to Maven Central

A few years ago I gathered this pagination component logic from a co-worker and changed it a little bit, adding some desirable functionality and reducing some external dependencies.
I've used in several projects, web-oriented and desktop-based and it accomplishes its works, pagination.

Today I spent a couple of hours configuring it for Maven Central, just to check if I could do it.

So, here it is, my first component published on Maven Central that can be used if you want to. I really like it and I encourage anybody to check it, review it, criticize it and trash it.

April 15, 2012

When you don't need a framework

I've been developing applications for a short time, from small to medium size codebases with many different features, requirements and environments. For all these applications I've always found the issue about the frameworks, sometimes this discussion takes days, or even weeks if the people involved is very passionate about Rails, Hibernate, JSF, CDI, and some others.

Mostly the discussions tend to be related to the benefits a framework can give us: speed, conventions, less coding, design improvements, being cool....

And for some projects the right frameworks have been a blessing, improving the developer experience and reducing development effort. But that's not always the case, because sometimes the frameworks can lead you to think that 'their' way to do it is the 'right' way.

'Their' way to do it can be 'right' for their intentions, but your application is not meant to be based on their intentions, but your customer ones. A framework should not define how your application is structured, how your business logic is wired, and not even how your tests are written.

I've always struggled with testing on a framework, because most of the times the requirements for its setup are so large, that makes you feel sick. And it's even worse if you are tied to certain technology because your customer has bought the 'sweetest' license in the market.

But well, here's my summary about frameworks:

Advantages

  • Speed, not always, but a lot of frameworks are performance-oriented.
  • Support, if it's open source, you will have a lot of it.
  • DRY, yeah, you don't reinvent the wheel.
  • Convention over configuration, very powerful, and saves lots of efforts.

Disadvantages

  • With bad design decisions, you can marry your code with a framework, and that marriage is an ugly one
  • Performance, as said, not all frameworks are performance-oriented.
  • Test difficulty, you mean that I have to setup the entire framework stack in order to test a single operation?

When to use them

  •  It's rare to find a reason not to use a framework, I would say that the question is not 'when to use a framework?', but 'how my application should be designed in order to be framework-agnostic?'.

When not to use them, or at least think twice before using them

  • When its usage doesn't give you any advantages
  • When you have a 'contractual' boundary with it
  • When your team dislikes it
  • When your tests take more than 10 seconds to setup its environment
  • When the framework itself is untestable
Based on: Architecture, the lost years - Robert C. Martin

October 2, 2011

Library management with Ivy

Back in the day, when I was a child, I used to manage all my project's libraries by hand, copying and moving everything I needed for a project into its respective folder.

I was happy with this for some time, but then I had to scale, handle several projects with a mixed set of dependencies. My original idea was to use a grown up tool like Maven, but its XML-hell led me out of it.



The alternative I chose is Apache Ivy, a dependency management tool that only does dependency management, and it's highly configurable (if you do it right).

In this way you can keep several projects linking a common libraries repository that is entirely handled by Ivy, you just configure it.

I recently updated some of my projects to this, the configuration files are quite simple and do all the work, including the Ivy-ant task installation if not available.

Ivy configurations for my Paginator-project

References