Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 454229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:15:01+00:00 2026-05-12T22:15:01+00:00

I have a calendar event object. I have plans to make it compatible with

  • 0

I have a calendar event object. I have plans to make it compatible with CalDAV/iCal/vCal protocols/file formats, which require the event be serialized and de-serialized to and from different formats.

I could write an ImportICal, ExportICal, ImportVCal, ExportVCal, etc. set of methods, but that doesn’t seem like a very good approach, because what if the vCal format is updated, etc.

Has anyone dealt with this type of import/export situation before? If so, what design pattern (if any) is generally best?

Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:15:01+00:00Added an answer on May 12, 2026 at 10:15 pm

    I am not particulary familiar with those formats but I’d create an simple data transfer object that represents your genereric calendar event object. It does nothing but holding the data (pseudocode):

    class CalendarEvent
    {
        DateTime Date { get; }
        string Title { get; }
        string Description { get; }
    }
    

    Then you create an interface for CalendarEventReader and CalendarEventWriter (it’s Strategy pattern and maybe the Builder pattern, sort of):

    interface ICalendarEventReader
    {
         CalendarEvent Read(Stream data);
         // Add additional methods if needed e.g.:
         string GetTitleOnly(Stream data);
    }
    interface ICalendarEventWriter
    {
         Stream Write(CalendarEvent event);
         // Add additional methods if needed e.g.:
         Stream WriteSummaryOnly(CalendarEvent event);
    }
    

    Then have actual implementations implement the above interfaces. One for each format. You can even think about having reader and writer in the same class:

    class CalDavConverter : ICalenderEventWriter, ICalendarEventReader
    {
        ...
    }
    

    You’d then have a Repository (it’s the Factory pattern maybe with Singleton) that maintains a list of ICalenderEventReader/Writer implementations for the different formats:

    static class CalenderEventConverterRepository
    {
        static ICalendarEventReader GetReader(string formatName /*or any other data upon wich to decide wich format is needed*/)
        { 
        ...
        }
    
        static ICalenderEventWriter GetWriter(string formatName /*or any other data upon wich to decide wich format is needed*/)
        { 
        ...
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an application which requires to add Calendar event. I have written
I have implemented event calendar application.In which I have added event data in iphone
I have a calendar control derived from DataGridView. A custom item hover event is
I have a text box with event name and two calendar controls to get
I run a church website and we have an event calendar page. We've been
I have three objects - Calendar, Event and Occurrence. A calendar has many events
I have two value objects, Calendar and Event, that are persistent. Calendar has a
I have a jquery calendar widget that do query several event sources on the
I have a calendar with an event list below it on my page. When
We have a ASP.Net Calendar control, and in the DayRender event, we have the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.