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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:39:06+00:00 2026-05-20T06:39:06+00:00

I am working on a business layer functionality. There are two layers :- 1)

  • 0

I am working on a business layer functionality.

There are two layers :-
1) Entity Data Model Layer which is the logical layer

This logical layer maps to a storage layer.

There are different classes in each of this layer.

The data storage layer has subject, test and result as objects
The logical layer has entity as objects.

I am writing a code which accepts an object of logical layer and converts it to storage layer objects.
It does so by reading the schema of the logical layer.

The schema of the logical layer is stored in an xml file and it has attributes which map to physical layer.

My code will interpret this schema and convert to appropriate physical layer objects.

The class which I have written is as follows :-

DataModelToStorageTranslator
{
 IStorageLayerObject TranslateToStorageLayer(ObjectOfLogicalLayer);
}

The different classes of the storage layer are derived from the IStorageLayerObject.

The client will check the type of object at runtime.

Is there a better way to achieve the same ?

My implementation is in C#

Thanks,
Vivek

  • 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-20T06:39:07+00:00Added an answer on May 20, 2026 at 6:39 am

    Unless there is a very good reason for using XML, I would avoid it. If you have a fixed number of objects that will need conversion from logical layer to storage layer I would suggest to create a DataModelToStorageTranslator facade like this:

    DataModelToStorageTranslator{
      SubjectStore translate(SubjectLogical subject);
      TestStore translate(TestLogical test);
      ResultStore translate(ResultLogical result);
    }
    

    That would give you more type safety as you will not need to check object types and cast. You will need to extend your interface anytime you want to add new objects (which I think is a good way of doing it for smaller projects).

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

Sidebar

Related Questions

I have a pre-existing c++ object model which represents the business layer tier of
I am working on two projects: A Business Logic Layer that is a class
I am working on maintaining an ASP.NET website, and I've noticed the business layer
I am working on a business problem in C#.NET. I have two classes, named
We are working on a large legacy application and we're redesigning the business layer
Currently I am working with a custom business object layer (adopting the facade pattern)
I am working on a Data Access Layer Design, we have not finalized what
Am working on a business layer for a complex web application and am temporary
I have a method in my business logic layer that accepts a stream, which
The project I'm working is using n-tier architecture. Our layers are as follows: Data

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.