Setting properties in session beans
<p>I have a session bean SessionBean and I have a property in that bean which is also an object, say Duck.</p>

<p>What would be the best way to access Duck from a class say AnimalUtils and why</p>

<p>Here are the two options I was thinking.... I am open to suggestions too, if there are any other way that is better than these</p>

<p>Also, If I decide to use option 1 where should I instantiate the Duck object??</p>

<p><strong>Option 1:</strong></p>

<pre><code>private duck = sessionBean.getDuck();
duck.setQuack("quack");
duck.getType();
duck.setFly(true);
</code></pre>

<p><strong>Option 2:</strong></p>

<pre><code>private duck = new Duck();
duck.setQuack("quack");
duck.getType();
duck.setFly(true);
sessionBean.setDuck(duck);
</code></pre>
