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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:52:11+00:00 2026-05-25T12:52:11+00:00

Imagine you have a page that is of a specific page type (for example

  • 0

Imagine you have a page that is of a specific page type (for example normal page, account page etc). The page is represented by a Page object.

My question is, how would you assign a page type to a page?

I see these options:

  1. by using a PageType enum that is set in the Page object.
  2. by using a PageType class, and assigning instances of it in the Page object.
  3. by using page tags, which are simple strings associated with the Page object.

Option 1 is code-only approach, so adding new page types means changing (core) code.
Option 2 is more flexible, but there is additional overhead in having to maintain these page types.
Option 3 is very flexible, because there’s no maintenance and it’s extendable to other mechanisms than page type. But you can easily break things because there are no constraints.

What would be other objective reasons to choose one over the other?

  • 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-25T12:52:12+00:00Added an answer on May 25, 2026 at 12:52 pm

    There is a lack of details regarding a system design and pages requirements, number of different page types to support and difference between pages itself, so hard to make such decision. In such case I would recommend to keep it simple and use Enum.

    • If pages has own specific business logic you can stick with class per Page type, but do it carefully only when really page-specific logic there.
    • Think about UserControl/CustomControl feature (assuming you are usign ASP.NET) so you can split page by a set of controls which is responsible on the part of Page functionality, so in this way you’ll keep Single Responsibility Principle and build less coupled system.
    • Some logic should be extracted from Page entities itself into external helpers/factories/repositories and then injected in Page class.

    Regarding objectives,
    you should define how many pages could be in place potentially and which level of flexibility should be provided. Also keep in mind such things like extensibility and maintenance of a system.

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

Sidebar

Related Questions

I think this is a simple question. Imagine you have a page that initializes
Imagine the scenario you have a listing page that is a concatenation of multiple
Imagine that HTML page is a game surface (see picture). User can have n
Let us have some simple page that allows logged users to edit articles. Imagine
Situation: Imagine that I have an item(page) located at 'sitecore/Content/Home/mypage' in my content tree.
Imagine I have a navigation bar in my page header, with a number of
I have a vertically scrolling uiscrollview - imagine an 'about this app' page of
Imagine I have a cell that I want to be red if the value
Let's imagine you have an asp.net page in front of you full of input
Let's imagine that I have something like this: <html> ... <div> <iframe src=test.html hash=r4d5f7></iframe>

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.