alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Commons Beanutils example source code file (bean-collections.xml)

This example Commons Beanutils source code file (bean-collections.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Commons Beanutils tags/keywords

apache, beanutils, beanutils, collections, collections, for, functors, java, license, license, see, this, you, you

The Commons Beanutils bean-collections.xml source code

<?xml version="1.0"?>
<!--
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
-->

<document>

 <properties>
  <title>Commons
  <author email="dev@commons.apache.org">Commons Documentation Team
 </properties>

 <body>

<section name="Commons BeanUtils Bean Collections">

<p>
Dealing with collections of beans is a common feature of development in Java.
A lot of time is spent creating bean-specific implementations 
for standard collection manipulators such as functors and comparators.
</p>

<p>
<code>BeanUtils Bean collections is a library intended to 
improve developer productivity by using sophisticated bean introspection 
(from <code>BeanUtils) 
to allow general library classes to be used (rather than creating bean specific
implementation classes).
</p>

<p>
But won't this be slower? Yes, reflection is slower than direct references
but in real life applications, this is typically insignificant. So why not use 
these classes to speed development and then substitute faster implementations only
where the profiler indicates there is a problem :) 
</p>
    <subsection name='Quick-Quick Guide To Functors'>
        <p>
Many of the classes in <code>bean-collections are functor implementations
specialized for bean properties. This is a very quick guide (aimed to let java developer
know why functors make for elegant code).
        </p>
        <p>
The word <code>functor is mathematical in origin but comes into object oriented
development from functional and logic coding. In Java terms, a functor 
is a function that is encapsulated as an object (and so can be manipulated as an object).
This allows elegant, concise and powerful techniques to be used. For example, 
<a href='http://commons.apache.org/collections'>Commons Collections
contains utilities that allow functions (as functors) to be easily applied to 
Collections.
        </p>
        <p>
This is actually pretty useful when it comes to collections of beans. It's a common 
problem to want to extract information from a collection of beans or to change all properties
to a particular value. Functors can be a particularly elegant way to do this. So try them!
You might just like them!
        </p>
        <p>
For more information about functors, please read the introduction to the
<a href='http://commons.apache.org/sandbox/functor/'>Commons Functor component.
        </p>
    </subsection>
</section>
<section name='Releases'>
        <p>
BeanUtils Bean-Collections is distributed as an optional jar within the main 
beanutils distribution. For details, see the 
<a href='http://commons.apache.org/beanutils/index.html'>main BeanUtils website
        </p>
</section>

</body>
</document>

Other Commons Beanutils examples (source code examples)

Here is a short list of links related to this Commons Beanutils bean-collections.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.