Yes, you are right. But accumulate method will be used only in test cases. I
think, that interface of class should be as brief as possible - only those
methods, which are required by business logic.

 

  _____  

From: Ivan Sidarau [mailto:notifications@github.com] 
Sent: Monday, December 16, 2013 10:49 AM
To: sidorovis/cpp_craft_1013
Cc: PeterMoroz
Subject: Re: [cpp_craft_1013] please, merge my project into master branch
(#213)

 

In
solutions/peter_moroz/minute-market-data-project/tests/minute_market_data_te
sts/minute_calculator_tests.cpp:

> +{
> +    boost::uint16_t ms = ::rand() % 1000;
> +    std::string timestamp = timestamp_as_string(h, m, s, ms);
> +
> +    double volume = ::rand();
> +    double price = ::rand();
> + 
> +    trade_message_ptr tmessage(new trade_message(timestamp, secsymbol,
price, volume));
> +    return tmessage;
> +}
> +
> +void multicast_communication::tests_::register_message(
> +    std::map<std::string, minute_datafeed>& data, quote_message_ptr& m)
> +{
> +  minute_datafeed& md = data[m->security_symbol()];
> +  md.set_bid(md.bid() + m->bid_price());

adding auto accumulating method (add_bid) is better from the point of OOP
view

-
Reply to this email directly or view
<https://github.com/sidorovis/cpp_craft_1013/pull/213/files#r8361016>  it on
GitHub.
<https://github.com/notifications/beacon/5584499__eyJzY29wZSI6Ik5ld3NpZXM6Qm
VhY29uIiwiZXhwaXJlcyI6MTcwMjcxNjUxNCwiZGF0YSI6eyJpZCI6MjE5NzMxNTl9fQ==--4cc5
09621daad30745198fd28dddb3bb1958c828.gif>