MFC to STL - Object Persistence? 
Author Message
 MFC to STL - Object Persistence?

I am in the process of componentizing my client/server application.  In the
process, I am looking to use ATL and STL and eliminate MFC (which my
applications are heavily dependent on!)  My client/server protocol uses
serialized objects.  (It's not uncommon to serialize a map object that
contains other maps & objects!)

My question is:

Has anyone created an STL class layer that implements a mechanism for
serializing objects?

Thanks,
Ben Henderson



Fri, 21 Jul 2000 03:00:00 GMT  
 MFC to STL - Object Persistence?

Hi

This isn't what you were after, but you could try using an object
database.  Object Design have a free products called ObjectStore PSE, at

www.odi.com

Hope this helps

Timothy Wild

Quote:

> I am in the process of componentizing my client/server application.  In the
> process, I am looking to use ATL and STL and eliminate MFC (which my
> applications are heavily dependent on!)  My client/server protocol uses
> serialized objects.  (It's not uncommon to serialize a map object that
> contains other maps & objects!)

> My question is:

> Has anyone created an STL class layer that implements a mechanism for
> serializing objects?

> Thanks,
> Ben Henderson


--
Timothy Wild
Massey University
New Zealand




Sat, 29 Jul 2000 03:00:00 GMT  
 MFC to STL - Object Persistence?


Quote:
>I am in the process of componentizing my client/server application.  In the
>process, I am looking to use ATL and STL and eliminate MFC (which my
>applications are heavily dependent on!)  My client/server protocol uses
>serialized objects.  (It's not uncommon to serialize a map object that
>contains other maps & objects!)

>My question is:

>Has anyone created an STL class layer that implements a mechanism for
>serializing objects?

>Thanks,
>Ben Henderson


Have you looked at the MFC source to see how they implment Serialize()? As I
recall it is fairly straightforward. Every class that needs to be serialized
has to implement this fuction and operator <<, >> methods to support writing
to a CArchive. Maps (and other containers) also implement these methods by
running a loop over every item in the collection streaming the item to/from
the CArchive&.

The only I problem I see with the MFC approach as opposed to the ATL/STL
combination is that everything in MFC derives from CObject. This makes
polymorphic calls on virtual operator<<() a snap. STL would eliminate the
need for a common base class, but you could decide to implement one anyway,
maybe class Serializable?

I suspect quite a lot of work is done to hide the complexity of streaming to
a file or an OLE structured storage (and maybe now some ActiveX Internet
stream). You would have to look into that as well.

I guess my proposal is to roll you own, but there may in fact exist some
simple class library or STL support add ons.



Mon, 31 Jul 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. STL and persistence

2. Object Persistence across forms

3. .Net Object Persistence Library Beta test

4. COM Object Persistence using OLEDB Help

5. Object Persistence with DAO

6. STL objects in MFC extension DLL

7. Persistence and Scalable / Stateless Server Objects

8. Persistence support for ActiveX ctrl in MFC

9. MFC + STL < STL

10. Objects vs. Pointers to Objects in MFC

11. COM object that uses MFC and MFC Socket class

12. COM object that uses MFC and MFC Socket class

 

 
Powered by phpBB® Forum Software