DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Which Is Better for IoT: Azure RTOS or FreeRTOS?
  • What ChatGPT Needs Is Context
  • Replacing Apache Hive, Elasticsearch, and PostgreSQL With Apache Doris
  • Never Use Credentials in a CI/CD Pipeline Again

Trending

  • Which Is Better for IoT: Azure RTOS or FreeRTOS?
  • What ChatGPT Needs Is Context
  • Replacing Apache Hive, Elasticsearch, and PostgreSQL With Apache Doris
  • Never Use Credentials in a CI/CD Pipeline Again
  1. DZone
  2. Data Engineering
  3. Databases
  4. The wages of sin: Re-creating the Stored Procedure API in C#

The wages of sin: Re-creating the Stored Procedure API in C#

Oren Eini user avatar by
Oren Eini
·
Mar. 21, 11 · News
Like (0)
Save
Tweet
Share
3.20K Views

Join the DZone community and get the full member experience.

Join For Free

this time, this is a review of the sharp commerce application. again, i have stumbled upon the application by pure chance, and i have very little notion about who wrote it. the problem is that this system seems to be drastically more complicated than it should be.

in this case, i want to look at the type of api that is exposed:

image

if this reminds you of the bad old days of having only stored procedure api available, that is not by chance. far worst than that, however, is the call paths where this is used.

iemailtemplaterepository.get(emailtemplatelookup) is implemented as

public emailtemplate get(emailtemplatelookup emailid)
{
return get((int)emailid);
}
and is only used in:

  • emailservice.get(emailtemplatelookup) whose implementation is:

          public emailtemplate getemail(emailtemplatelookup template)
    {
    return emailtemplaterepository.get(template);
    }



icategoryrepository.getparentcategories
is only used from:

  • categoryservice.getparentcategories which is implemented as:
    public ienumerable<category> getparentcategories()
    {
    ienumerable<category> categories = categoryrepository.getparentcategories();

    return categories;
    }


icurrencyrepository.getenabledcurrencies is only used from:

  • currencyservice.getenabledcurrencies which is implemented as:
    public ienumerable<currency> getenabledcurrencies()
    {
    return currencyrepository.getenabledcurrencies();
    }
    for that matter, let us take a look at the entire currencyservice class, shall we?

    public class categoryservice : icategoryservice
    {
    private readonly icategoryrepository categoryrepository;

    public categoryservice(icategoryrepository categoryrepository)
    {
    this.categoryrepository = categoryrepository;
    }

    public ilist<category> getcategories()
    {
    return categoryrepository.getall();
    }

    public category getcategory(int id)
    {
    return categoryrepository.get(id);
    }

    public void saveorupdate(category categorymodel)
    {
    categoryrepository.saveorupdate(categorymodel);
    }

    public void delete(category category)
    {
    categoryrepository.delete(category);
    }

    public ienumerable<category> getparentcategories()
    {
    ienumerable<category> categories = categoryrepository.getparentcategories();

    return categories;
    }
    }

    to be honest, i really don’t see the point .

    now, just a hint on the next few posts, there are places where i think wrapping the usage of the nhibernate api was a good idea, even if i strongly disagree with how this was done.

API

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • Which Is Better for IoT: Azure RTOS or FreeRTOS?
  • What ChatGPT Needs Is Context
  • Replacing Apache Hive, Elasticsearch, and PostgreSQL With Apache Doris
  • Never Use Credentials in a CI/CD Pipeline Again

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: