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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:49:53+00:00 2026-05-26T16:49:53+00:00

I’m currently creating objects for an application of mine when this stuff come to

  • 0

I’m currently creating objects for an application of mine when this stuff come to mind. I know that using DBML’s over Manual Creation of classes(see class below) can improve the speed of my application development but I’m really confused of what would be the other disadvantages and advantages of using DBML’s over Manual Creation of classes like what I’m doing below thanks for all people who would help. 🙂

[Serializable]
public class Building
{
    public Building()
    {
        LastEditDate = DateTime.Now.Date;
        LastEditUser = GlobalData.CurrentUser.FirstName + " " + GlobalData.CurrentUser.LastName;
    }

    public int BuildingID { get; set; }
    public string BuildingName { get; set; }
    public bool IsActive { get; set; }
    public DateTime LastEditDate { get; set; }
    public string LastEditUser { get; set; }

    public static bool CheckIfBuildingNameExists(string buildingName, int buildingID = 0)
    {
        return BuildingsDA.CheckIfBuildingNameExists(buildingName, buildingID);
    }

    public static Building CreateTwin(Building building)
    {
        return CloningUtility.DeepCloner.CreateDeepClone(building);
    }

    public static List<Building> GetBuildingList()
    {
        return BuildingsDA.GetBuildingList();
    }

    public static List<Building> GetBuildingList(bool flag)
    {
        return BuildingsDA.GetBuildingList(flag).ToList();
    }

    public static Building SelectBuildingRecord(int buildingId)
    {
        return BuildingsDA.SelectBuilding(buildingId);
    }

    public static void InsertBuildingRecord(Building building)
    {
        BuildingsDA.InsertBuilding(building);
    }

    public static void UpdateBuildingRecord(Building building)
    {
        BuildingsDA.UpdateBuilding(building);
    }

    public static void DeleteBuildingRecord(int building)
    {
        BuildingsDA.DeleteBuilding(building);
    }
}

and my DAL is like this:

internal static class BuildingsDA
{
    internal static Building SelectBuilding(int buildingId)
    {
        SqlCommand commBuildingSelector = ConnectionManager.MainConnection.CreateCommand();
        commBuildingSelector.CommandType = CommandType.StoredProcedure;
        commBuildingSelector.CommandText = "Rooms.asp_RMS_Building_Select";
        commBuildingSelector.Parameters.AddWithValue("BuildingID", buildingId);

        SqlDataReader dreadBuilding = commBuildingSelector.ExecuteReader();
        if (dreadBuilding.HasRows)
        {
            dreadBuilding.Read();
            Building building = new Building();
            building.BuildingID = int.Parse(dreadBuilding.GetValue(0).ToString());
            building.BuildingName = dreadBuilding.GetValue(1).ToString();
            building.IsActive = dreadBuilding.GetValue(2).ToString() == "Active";
            building.LastEditDate = dreadBuilding.GetValue(3).ToString() != string.Empty ? DateTime.Parse(dreadBuilding.GetValue(3).ToString()) : DateTime.MinValue;
            building.LastEditUser = dreadBuilding.GetValue(4).ToString();
            dreadBuilding.Close();
            return building;
        }
        dreadBuilding.Close();
        return null;
    }

    ....................
}

I would also want to know if what could be the faster between the two methods of OOP implementation thanks 🙂

  • 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-26T16:49:54+00:00Added an answer on May 26, 2026 at 4:49 pm

    DBML

    Pros:

    1. You can get your job done fast!

    Cons:

    1. You can’t shape your entity the way you want, for example you need 5 columns from the table but it has 10 columns you will get all of them, at least its schema. If you don’t care much about data volum
    2. You client side will have dependency with DAL (Data Access Layer), if you change property name, type in DAL you need to change in both BLL (Business Logic Layer) and client (Presentation Layer)

    If you manual create class you might take a little bit more time to code but you get more flexible with it. Your client code will not depend on your DAL, any changes on DAL will not cause problems on client code.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I am currently running into a problem where an element is coming back from

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.