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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:36:43+00:00 2026-05-10T23:36:43+00:00

I have a function that identify coordinates on a page, and I am returning

  • 0

I have a function that identify coordinates on a page, and I am returning them as a

Dictionary<int, Collection<Rectangle>> GetDocumentCoordinates(int DocumentId) 

However, later I need information about each page – if it was validated, what is the page resolution, color/bw, etc. I could create another function and run through pretty much the same result set as the previous function and get that information.

Dictionary<int, PageInfo> GetDocumentAttributes(int DocumentId) 

Another alternative would be to add a ref parameter so I can get these values back.

Dictionary<int, Collection<Rectangle>> GetCoordinates(int DocumentId, ref Dictionary<int, PageInfo> PageAttributes) 

Yet another alternative is to create an encompassing class that contains the Dictionary and the page information:

class DocumentInfo {     Dictionary<int, Collection<Rectangle>> Coordinates { get; set;}     Dictionary<int, PageInfo> PageAttributes { get; set; } } 

and then define:

DocumentInfo GetDocumentInfo(int DocumentId); 

I’m leaning towards the last option, but your insights are very much appreciated.

  • 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-10T23:36:44+00:00Added an answer on May 10, 2026 at 11:36 pm

    The last option is definitely the best. I’ve found that, when taking or returning complex data with multiple meanings, creating a complex type to encapsulate this data is the best practice for a number of reasons.

    First, your return data probably will change as your design changes. Encapsulating this data in an object allows you to alter what it carries and how your methods operate on this data without altering the interfaces of your objects. Obviously, your data object shouldn’t implement an interface; at most, have a base class with the minimum interface and then pass references to the base around.

    Second, you may find your data gets complex to the point where you will need to perform validation on it. Rather than have this validation in all the methods of your classes where you act upon this data, you can easily wrap this up in the data class. Single responsibility, etc.

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

Sidebar

Ask A Question

Stats

  • Questions 57k
  • Answers 57k
  • 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
  • added an answer It would appear that the ReflectionOnlyAssemblyResolve event is only used… May 11, 2026 at 8:26 am
  • added an answer What about: function isNumber(n){ return typeof(n) != 'boolean' && !isNaN(n);… May 11, 2026 at 8:26 am
  • added an answer Try this on for size... <ListBox> <ListBoxItem><local:MyEnum>Value1</local:MyEnum></ListBoxItem> <ListBoxItem Margin='10'><local:MyEnum>Value2</local:MyEnum></ListBoxItem> <ListBoxItem><local:MyEnum>Value3</local:MyEnum></ListBoxItem>… May 11, 2026 at 8:26 am

Top Members

Trending Tags

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

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

MEILI PLUGIN ACTIVE

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.