Take the 2-minute tour ×
Code Review Stack Exchange is a question and answer site for peer programmer code reviews. It's 100% free, no registration required.
[Bindable]
public class ProductsCache
{
    private static var _products:ArrayCollection;

    public function get products():ArrayCollection{
        return _products;
    }
    public function set products(value:ArrayCollection):void{
        _products = value;
    }
}

By the name of the class you see my intentions with this bit of code. I intend to set a "cache" of registries that I intend to use across modules and update accordingly. The get method is used for dropdown lists, the set method after a successful insert statement.

This works good for my needs. But I still need your feedback.

EDIT: I don't know what voting means here. Is this good code for its purpose? or do I really need to learn factories and dependency injections?

I was previously using a singleton for this, but I wasn't comfortable with that, I want to keep the singleton excusively for credential and config data. And use this for the rest of the app functionality.

share|improve this question
 
Feedback on what? If you should use static variables? If you should do it like that? –  Bobby Oct 5 '11 at 7:06
 
Yep. That's important to me. –  overmann Oct 5 '11 at 14:25
 
Damn it Jim, state in your question what you want! –  Bobby Oct 5 '11 at 14:26
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.