Hi dulitha,

I'm ok with above methods. But I have a minor concern that having
overloaded methods like these might affect the readability of code.

For example when you use these methods you'll have to call it like,

featureManager.getFeatures(deviceId);

But if you have used a method like getFeaturesOfDevice, you could have use
it like

featureManager.getFeaturesOfDevice(deviceId);

So as you can see when we read the code we know that "getFeaturesOfDevice"
method will return features of a device. But when we use getFeatures()
there is no way to know what exactly that method does until we check the
type of object sent as the parameter.

Anyway this is a minor concern :).

Thanks,

Lakshitha Harshan
Software Engineer
Mobile: *+94724423048*
Email: hars...@wso2.com
Blog : http://harshanliyanage.blogspot.com/
*WSO2, Inc. :** wso2.com <http://wso2.com/>*
lean.enterprise.middleware.

On Wed, Mar 18, 2015 at 10:03 AM, Dulitha Wijewantha <duli...@wso2.com>
wrote:

> Hi guys,
> I have an Interface called FeatureManager. I want to have methods to
> retrieve features for device type, device identifier and all features. Is
> it consistent with our practice to name these methods as below -
>
>    - getFeatures (String deviceType)
>    - getFeatures (DeviceIdentifier deviceIdentifier)
>    - getFeatures() - get all features
>
> Or do you prefer it if the methods are not overloaded?
>
> ​Cheers~​
>
> --
> Dulitha Wijewantha (Chan)
> Software Engineer - Mobile Development
> WSO2 Inc
> Lean.Enterprise.Middleware
>  * ~Email       duli...@wso2.com <duli...@wso2mobile.com>*
> *  ~Mobile     +94712112165 <%2B94712112165>*
> *  ~Website   dulitha.me <http://dulitha.me>*
> *  ~Twitter     @dulitharw <https://twitter.com/dulitharw>*
>   *~Github     @dulichan <https://github.com/dulichan>*
>   *~SO     @chan <http://stackoverflow.com/users/813471/chan>*
>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to