473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

IMPL does not implement interface member

Getting three errors, all same on different items. RetrieveBookList, RetrieveBook, StoreBookList. It appears as though it is ok for StoreBook though. Not real sure what I am missing. Any help would be appreciated :-)
Expand|Select|Wrap|Line Numbers
  1. public class BookSvcBinImpl : IBookService
  2.     {
  3.         public void StoreBook(Book bookX)
  4.         {
  5.             IList<Book> listBooks = new IList<Book>();
  6.             FileStream saveStream = new FileStream("Book.bin", FileMode.Create, FileAccess.Write);
  7.             IFormatter formatter = new BinaryFormatter();
  8.             formatter.Serialize(saveStream, bookX);
  9.             saveStream.Close();
  10.         }
  11.  
  12.         public Book RetrieveBook()
  13.         {
  14.             FileStream loadStream = new FileStream("Book.bin", FileMode.Open, FileAccess.Read);
  15.             //IFormatter formatter = new BinaryFormatter();
  16.             IList<Book> listBooks = formatter.Deserialize(loadStream) as IList<Book>;
  17.             //Book bookX = formatter.Deserialize(loadStream) as Book;
  18.             loadStream.Close();
  19.             //return bookX;
  20.         }
  21.     }
  22.  
Expand|Select|Wrap|Line Numbers
  1.     public interface IBookService : IService
  2.     {
  3.         void StoreBook(Book bookx);
  4.         void StoreBookList(Book[] bookx);
  5.         void RetrieveBook(Book bookx);
  6.         Book[] RetrieveBookList(int maxcount);
  7.         //Book RetrieveBook();
  8.     }
  9.  
Expand|Select|Wrap|Line Numbers
  1. public class Book
  2.     {
  3.         private string ISBN;                     // ISBN of the book.
  4.         private string Status;                   // Status of the book.
  5.         private string Title;                    // Title of the book.
  6.         private string Series;                   // Series of the book.
  7.         private string Author;                   // Author of the book.
  8.         private string Description;              // Description of the book.   
  9.         //private bool Addition;                   // Addition of book.
  10.  
  11.         private Book() { }
  12.         public Book(string isbn, string status, string title, string series, string author, string description)
  13.         {
  14.             ISBN = isbn;
  15.             Status = status;
  16.             Title = title;
  17.             Series = series;
  18.             Author = author;
  19.             Description = description;
  20.             //Addition = addition;
  21.         }
  22.  
  23.         public string isbn
  24.         {
  25.             get { return ISBN; }
  26.             set { ISBN = value; }
  27.         }
  28.  
  29.         public string status
  30.         {
  31.             get { return Status; }
  32.             set { Status = value; }
  33.         }
  34.  
  35.         public string title
  36.         {
  37.             get { return Title; }
  38.             set { Title = value; }
  39.         }
  40.  
  41.         public string series
  42.         {
  43.             get { return Series; }
  44.             set { Series = value; }
  45.         }
  46.  
  47.         public string author
  48.         {
  49.             get { return Author; }
  50.             set { Author = value; }
  51.         }
  52.  
  53.         public string description
  54.         {
  55.             get { return Description; }
  56.             set { Description = value; }
  57.         }
  58.  
  59.         //public bool addition
  60.         //{
  61.         //    get { return Addition; }
  62.         //    set { Addition = value; }
  63.         //}
  64.  
  65.         public bool ValidateBook()
  66.         {
  67.             if (status == null)
  68.                 return false;
  69.             if (title == null)
  70.                 return false;
  71.             return true;
  72.         }
  73.  
  74.         override public bool Equals(Object o)
  75.         {
  76.             if (!(o is Book)) return false;
  77.             Book book = (Book)o;
  78.             if (!book.ISBN.Equals(ISBN)) return false;
  79.             //if (!book.Status.Equals(Status)) return false;
  80.             //if (!book.Title.Equals(Title)) return false;
  81.             //if (!book.Series.Equals(Series)) return false;
  82.             //if (!book.Author.Equals(Author)) return false;
  83.             //if (!book.Description.Equals(Description)) return false;
  84.             //if (!book.Addition.Equals(Addition)) return false;
  85.             return true;
  86.         }
  87.  
Oct 13 '10 #1
1 1673
You must implement IBookService interface:

Expand|Select|Wrap|Line Numbers
  1. public class BookSvcBinImpl : IBookService
  2.     {
  3.         public void StoreBook(Book bookX)
  4.         {
  5.             IList<Book> listBooks = new IList<Book>();
  6.             FileStream saveStream = new FileStream("Book.bin", FileMode.Create, FileAccess.Write);
  7.             IFormatter formatter = new BinaryFormatter();
  8.             formatter.Serialize(saveStream, bookX);
  9.             saveStream.Close();
  10.         }
  11.  
  12.         public void RetrieveBook()
  13.         {
  14.             FileStream loadStream = new FileStream("Book.bin", FileMode.Open, FileAccess.Read);
  15.             //IFormatter formatter = new BinaryFormatter();
  16.             IList<Book> listBooks = formatter.Deserialize(loadStream) as IList<Book>;
  17.             //Book bookX = formatter.Deserialize(loadStream) as Book;
  18.             loadStream.Close();
  19.             //return bookX;
  20.         }
  21.  
  22.         public void StoreBookList(Book[] bookx) 
  23.         { 
  24.            //Implementation 
  25.         }
  26.  
  27.         public Book[] RetrieveBookList(int maxcount)
  28.         {
  29.            //implementation
  30.         }
  31.     }
  32.  
Oct 13 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Armin Zingler | last post by:
Hi group, how can I have a base class member implement an interface member? Example: class a sub Member1 end sub end class
52
by: Ben Voigt [C++ MVP] | last post by:
I get C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member...
3
by: =?Utf-8?B?Sm9uIEU=?= | last post by:
I have an interface class with maybe eight functions, defined in one workspace and am defining a class in a second workspace that derives from this interface. Unfortunately only 7 of the 8...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.