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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:06:47+00:00 2026-05-26T19:06:47+00:00

I really like being able to organization my objects like this where Source is

  • 0

I really like being able to organization my objects like this where Source is it’s own object inside the Document object.

METHOD #1

Dim doc As New Process.Document()
doc.Source.Type = "URL"
doc.Source.Data = "http://myOtherDomain/MyOtherPage.htm"

<View #1 PasteBin Full Code>

However, is it a better practice to do something like this?

METHOD #2

Dim doc As New Process.Document()
doc.SourceType = "URL"
doc.SourceData = "http://myOtherDomain/MyOtherPage.htm"

<View #2 PasteBin Full Code>

The reason I ask is because it gets a little confusing with the first method because You get this:

Process.Document.DocumentSource and doc.Source

I think that in method #1, Process.Document.DocumentSource is redundant having Document twice and wish there was a way to hide that object from being selectable in the intellisense dropdown list by the user of the assembly.

But on the flip-side, if you have a LOT of properties, it seems better to be able to group them into sub-objects like method #1 does so you don’t have a hundred properties all listed in the Intellisense dropdown list.

  • 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-26T19:06:48+00:00Added an answer on May 26, 2026 at 7:06 pm

    The Law of Demeter says Method #2 is the way to go, given just those two options.

    A third method could be providing the Source object instead of setting doc.Source.XYZ.

    // C# -- don't know VB.Net
    var source = new DocumentSource();
    ...
    
    doc.Source = source;
    

    A fourth method would effectively be constructor injection if the Source is required.

    var source = new DocumentSource();
    ...
    var doc = new Process.Document(source);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really like being able to use =~ and !~ in Perl to evaluate
I really like being able to the command-line tool gitx from Terminal.app to open
I really like being able to the command-line tool gitx from Terminal.app to open
I really like being able to the command-line tool gitx from Terminal.app to open
I really like git. At least, I like the idea of git. Being able
I really like this approach for handling sqlite database when developing for Android but
One of the things I really miss from javascript/jquery work is being able to
After using the Django template language, I really miss being able to do things
I really like the fact that Microsoft has taken a commitment to bring MVC
I really like DevX components, but they are pretty expensive, maybe anyone knows free

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.