We developed an N-tier architecture application using WCF between the client (presentation) and the server (data / business tier). Honestly, I cannot find any real examples / information on how to expose efficiently calculated data through WCF.
To describe my problem, we say that we have ATMs that have many transactions. Thus, we have a 1-N relationship between the ATM class and the transaction class. The ATM class has properties such as Location, ModelNo, Description, InstallDate, and transaction records such as Amount, DateTime, CustomerInfo, TicketPaperLength, ElectricityUsed
Providing these classes through WCF is not a problem. The problem is that we have many calculated fields for ATM, which are based on a base transaction table. For example, a client application uses reports based on calculated ATM data. Examples of ATM settlement data can be: AverageTicketPaperLength, AverageAmount, DeviationAmount, AverageElectricity, etc. Etc. There are many, many of these estimates. Settlements should be made on the server, not on the client side. If these report definitions were fixed, this would not be a big problem: we could create separate services / Pocos for reports. Put the calculations in the business layer and fill out Poco as needed. But the client application should be able to filter reports for any set of calculated ATM properties and return another set of (calculated) properties as data.
I could create a Poco with approximately 500 calculated properties, where for each individual report only 10 properties can be used. But, of course, we do not want all 500 calculations to be performed each time for each object.
So, in general, I wonder how you can set the calculated data of the object through, for example, WCF. Almost all the examples I see explaining that the Entity Framework, Poco, and WCF deal only with the constant fields of an object, and this is pretty straight forward.