Bugzilla – Bug 146
Ipv4Address API cleanup
Last modified: 2008-07-01 13:32:24 UTC
This patch proposes to remove the "HostOrder" postfix of the name of getters and setters in Ipv4Address. Instead, all Getters and Setters are host order; if we introduce network order getters and setters, we could perhaps qualify those with the "NetworkOrder" postfix such as "SetNetworkOrder" (but presently there are no such methods). It also does a bit of API cleanup/doxygen and removes redundant methods. (suggested by George and extended by Tom)
Created attachment 115 [details] the proposed API changes and source code alignment
(In reply to comment #0) > This patch proposes to remove the "HostOrder" postfix of the name of getters > and setters in Ipv4Address. Instead, all Getters and Setters are host order; > if we introduce network order getters and setters, we could perhaps qualify > those with the "NetworkOrder" postfix such as "SetNetworkOrder" (but presently > there are no such methods). I think that the long method name is actually nice and descriptive so, I find it weird to make the method names less descriptive.
(In reply to comment #2) > (In reply to comment #0) > > This patch proposes to remove the "HostOrder" postfix of the name of getters > > and setters in Ipv4Address. Instead, all Getters and Setters are host order; > > if we introduce network order getters and setters, we could perhaps qualify > > those with the "NetworkOrder" postfix such as "SetNetworkOrder" (but presently > > there are no such methods). > > I think that the long method name is actually nice and descriptive so, I find > it weird to make the method names less descriptive. > Yes, it is more descriptive, but longer to type, and e.g. the constructor assumes host order without such a qualifier. All of the getters and setters are host order; we have network byte order methods but they are called Serialize and Deserialize and operate on a byte array. I could live with GetHostOrder and SetHostOrder if we removed redundant Set() methods already there, and removed the warnings around their usage, but it seems simpler to me to just say Set() and Get().
> > > This patch proposes to remove the "HostOrder" postfix of the name of getters > > > and setters in Ipv4Address. Instead, all Getters and Setters are host order; > > > if we introduce network order getters and setters, we could perhaps qualify > > > those with the "NetworkOrder" postfix such as "SetNetworkOrder" (but presently > > > there are no such methods). > > > > I think that the long method name is actually nice and descriptive so, I find > > it weird to make the method names less descriptive. > > > > Yes, it is more descriptive, but longer to type, and e.g. the constructor > assumes host order without such a qualifier. All of the getters and setters > are host order; we have network byte order methods but they are called > Serialize and Deserialize and operate on a byte array. ok. That is a good point.
[ping] what is the status of this bug ? Do you still want to apply this ?
[pong] I lost track of that one but yes, I still think it is valid.
changeset 1763f7ac8e80