It depends on whether the *instanceId* is mandatory or not. If it is
mandatory, you should modify the existing constructor and have it in the
constructor. If it is not mandatory, you should have a setter.

Thanks.

On Mon, Jun 1, 2015 at 9:43 PM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi,
>
> Cloud controller creates a Member object which represents an instance in
> IaaS. Then it sends an event with the member details so other components
> get updated.
> Could you describe what is instanceId you trying to add so we can find a
> the most suitable approach.
>
> On Mon, Jun 1, 2015 at 8:33 PM, Swapnil Patil <swapnil.r...@gmail.com>
> wrote:
>
>> Hi Devs,
>>
>> I am adding a new field
>> in org.apache.stratos.messaging.domain.topology.Member class, called
>> instanceId.
>>
>> For this, what would be a better approach
>>
>> 1. Modifying the existing constructor
>> 2. Adding a new constructor which takes this as an additional argument
>> 3. Just have a setter method.
>>
>> In case of 2 and 3, the member may not be initialized properly.
>>
>> I am confused about which to use because I am unaware of the scope of
>> this Member class. If this is widely used then option 1 would mean changes
>> at a lot of places.
>>
>> If I know what is the scope of this Member class, it would help me
>> determine which approach to follow. Is there any way to find out in what
>> all places a class's object is used apart from searching it manually
>> through the codebase?
>>
>> I would appreciate any help in deciding the approach.
>>
>> Thanks and Regards,
>> Swapnil
>>
>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 
Rajkumar Rajaratnam
Committer & PMC Member, Apache Stratos
Software Engineer, WSO2

Mobile : +94777568639
Blog : rajkumarr.com

Reply via email to