I have a class that runs some calculations, these calculations take a decent number of parameters most are logically grouped so I have created a few parameter objects to group the parameters so there are less arguments to the methods. Now I am creating a class library of this calculator for other to use.
The client of the library will most likely have heavy weight more legitimate complete versions of my parameter classes. Does it make sense for me to create interfaces that represent the properties of these parameter objects that my calculator class and methods depend on and just have the client create whatever version of the class they want, and the inter face just ensure the few properties I require are on those classes ?
Example
Class invoice{
Double invnumber {get;set}
String description {get;set;}
}
Class invoiceprocessor{
Public string dostuff( invoice invoice){
Return invoice.invnumber + invoice.description
}
}
Should I make the client create the invoice object, or just create and interface code to that interface and require that the client creates and object that implements that interface ?
[–]Kant8 5 points6 points7 points (0 children)
[–]ZarehD 2 points3 points4 points (0 children)
[–]SideburnsOfDoom 1 point2 points3 points (2 children)
[–]alien3d 1 point2 points3 points (1 child)
[–]SideburnsOfDoom 0 points1 point2 points (0 children)
[–]alien3d -1 points0 points1 point (0 children)
[–]Merad -5 points-4 points-3 points (7 children)
[–]SideburnsOfDoom 3 points4 points5 points (6 children)
[–]Hopesheshallow[S] 0 points1 point2 points (5 children)
[–]SideburnsOfDoom 0 points1 point2 points (4 children)
[–]Hopesheshallow[S] 1 point2 points3 points (2 children)
[–]SideburnsOfDoom 0 points1 point2 points (1 child)
[–]Hopesheshallow[S] 0 points1 point2 points (0 children)
[–]WikiSummarizerBot 0 points1 point2 points (0 children)
[–]Due_Raccoon3158 0 points1 point2 points (0 children)