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 100005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:29:47+00:00 2026-05-11T00:29:47+00:00

Today I was looking at some code atually from Nikhil Kothari’s Facebook.NET API. I

  • 0

Today I was looking at some code atually from Nikhil Kothari’s Facebook.NET API. I just wanted to check out how he was doing some things in there for ideas.

One of the things I came across was a Property that just seemed really weird to me.

check this out:

FacebookRequest.cs defines a property and sets it in the constructor to a new instance of a custom Class:

    public FacebookRequest(FacebookSession session) {         ....         _parameters = new FacebookRequestParameterList();     } 

private field:

private FacebookRequestParameterList _parameters;

and the property:

    public FacebookRequestParameterList Parameters {         get {             return _parameters;         }     } 

now the FacebookRequestParameterList is actually a Generic Dictionary because it inherits & extends Dictionary:

public sealed class FacebookRequestParameterList : Dictionary<string, string> { ... } 

Ok so essentially when you instantiate FacebookRequest, it therefore automatically comes with an auto-instantiated instance of the FacebookRequestParameterList class. So the Property is essentially returning an instance of FacebookRequestParameterList.

Is that normal? I don’t think I’ve seen that a lot. Seems sneaky to me or is this standard stuff here? It just seemed like an odd way to do it. I’m not posting this to bring him down but to understand if this is something standard or sneaky/evil.

It seems to me it would be better to require developers to pass in an instance of FacebookRequestParameterList through the constructor of FacebookRequest instead. And then work with that by setting the private field _parameters after you initialize it through the constructor. Why do I think this is better? Because then developers know exactly what’s going on. They know that the class expects a parameter list up front. And just exposing an instance like that through a properly to me just seems odd.

Am I off base here?

  • 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. 2026-05-11T00:29:48+00:00Added an answer on May 11, 2026 at 12:29 am

    I don’t think it’s odd at all. It saves the client the trouble of having to instantiate the FacebookRequestParameterList instance, and the FacebookRequest class is guaranteed that _parameters contains a valid instance of the FacebookRequestParameterList class, and isn’t null.

    It’s a matter of convenience for the client, and object validity for the class itself.

    Nothing to see here, people, move along.

    (Edit: clarified the specific instance in the first paragraph)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 108k
  • Answers 108k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The easiest way I found to do it is using… May 11, 2026 at 9:10 pm
  • Editorial Team
    Editorial Team added an answer With 2k05/2k08 it's definitely better to partition a single database.… May 11, 2026 at 9:10 pm
  • Editorial Team
    Editorial Team added an answer If you have a Haskell compiler that uses strict evaluation,… May 11, 2026 at 9:10 pm

Related Questions

Today I was looking at some code atually from Nikhil Kothari's Facebook.NET API. I
There was a bit of a surprise with some code today. I was compiling
I was looking at the online help for the Infragistics control library today and
Our company has a point of sale system with many extras, such as ordering
Today I was listening to the Hanselminutes show about .NET 3.5 SP1...What's inside ,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.