reset password
Author Message
JCA08
Posts: 12
Posted 21:11 May 03, 2017 |

I'm a bit confused on the usage of the BinaryMonsterPersister class. Is that where we store the list of attacks?

jhurley
Posts: 207
Posted 07:58 May 04, 2017 |

That part is very, very much like my binary file i/o example.  The only differences are that you are working with a list of MonsterAttacks instead of a list of Vampires, and that you need to write an interface that requires the save and retrieve methods, then implement the interface, where my example just uses a class directly.

lugo96
Posts: 3
Posted 18:00 May 08, 2017 |

so instead of implementing the serializable we implement the MonsterPersister interface?

jhurley
Posts: 207
Posted 18:09 May 08, 2017 |

Yes, create the interface and implement it.  The Persister doesn't have to be serializable-that was a typo in my code.

lugo96
Posts: 3
Posted 18:19 May 08, 2017 |

also, do we need to have a monster attack driver class to get our main to create new objects and call our monitor?

jhurley
Posts: 207
Posted 18:57 May 08, 2017 |

Not required, but you can write a driver or unit tests if it helps you get the persistence methods right