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

  • Home
  • SEARCH
  • 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 8940907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:10:09+00:00 2026-06-15T11:10:09+00:00

I am developing a rich client application using WPF-PRISM-MVVM. The client interacts with a

  • 0

I am developing a rich client application using WPF-PRISM-MVVM.
The client interacts with a repository service which provides CRUD functionality and publishes any changes for domain entities via WCF channel.
The client handles domain entities cache in order to improve performance and provide offline functionality.
For that purpose I wrote a repository agent service which lives on the client side and wraps the repository service and handles caching and changes propagation to the relevant client side component that have interests in domain entities changes.

After the long introduction my question is this the way to do it?
Are there any client side data handling and caching patterns that I should aware of?

Cheers,
Doron

  • 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-06-15T11:10:11+00:00Added an answer on June 15, 2026 at 11:10 am

    We use AOP in the form of PostSharp for our client side caching, we simply add an attribute to a method and viola it is cached :

    Our aspect looks like this- it defers the actual cache implementation to an instance of ICacheService but you get the idea.

    [Serializable]
    [MulticastAttributeUsage(MulticastTargets.Method, PersistMetaData = true)]
    public class MethodCacheAttribute : MethodInterceptionAspect
    {
    
        public const int DefaultCacheSeconds = 600;
        private ICacheService CacheService { get; set; }
        private string methodName;
    
        [IntroduceMember(Visibility = PostSharp.Reflection.Visibility.Family, OverrideAction = MemberOverrideAction.Ignore, IsVirtual = true)]
        public double CacheForSeconds { get; set; }
    
    
        public MethodCacheAttribute() : this(DefaultCacheSeconds ) { }
        public MethodCacheAttribute(int seconds)
        {
            this.CacheForSeconds = seconds;
        }
    
        public override void CompileTimeInitialize(MethodBase method, AspectInfo aspectInfo)
        {
            this.methodName = method.Name;
        }
    
        public sealed override void OnInvoke(MethodInterceptionArgs args)
        {
            var key = this.BuildCacheKey(args.Arguments,args.Method);
    
            var item = ServiceLocator.Current.GetInstance<ICacheService>().Cache<object>(key, () =>
                {
                    return args.Invoke(args.Arguments);
                },CacheForSeconds ==0 ? TimeSpan.MaxValue :  TimeSpan.FromSeconds(CacheForSeconds));
                args.ReturnValue = item;
        }
    
    
        private string BuildCacheKey(Arguments arguments, MethodBase method)
        {
            var sb = new StringBuilder();
            sb.Append(this.methodName);
    
            foreach (var argument in arguments.ToArray())
            {
                sb.Append(argument == null ? "_" : argument.GetHashCode().ToString());
            }
    
            if (method.IsGenericMethod)
            {
                var genericArgs = String.Join("-", method.GetGenericArguments().Select(t => t.Name));
                sb.Append(genericArgs);
            }
    
            return sb.ToString();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been developing a minimalistic Java rich client CRUD application framework for the past
I'm developing a rich client web application which deals with a large volume of
I am developing a rich client web application and wondering whether which framework would
I am developing a rich client application that will use the Entity Framework (with
I am currently developing a Web-Application using Java EE where I'm using a Rich-Javascript-Editor
We are developing web application using JSF. We are using rich faces on Jboss
I'm using rich text editors (tiny_mce) pretty widely in a web application I'm developing.
While developing an application using gwt in ecliplse crashed. Now the server is running
I'm developing a rich Internet application that requires a Java 7 platform. How can
Background: I'm developing an HTML5 webapp for my company which is basically a Rich

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.