Giter VIP home page Giter VIP logo

customersync-eib's Introduction

Code changes include following:

  • Separate business layer from data layer
  • Synchronize an additional field 'bonusPointsBalance'
  • Update the existing tests to verify that bonusPointsBalance is updating correctly
  • Introduced interfaces for potential future extensibility
  • Structured the application by breaking it into packages
  • Removed unreachable code
  • Removed unnecessary if statement
  • Get rid of duplicate code
  • Get rid of hard-coded strings and used enum instead
  • Reduce code complexity and improve code readability by introducing several new methods

Further improvements to consider:

I don't like the way we are updating duplicates one by one in the for each loop. If it weren't for a 'fakeDatabase,' I would refactor it to perform the save operation in 'bulk' so that there would be only one SQL statement. In the case of using OracleDB, we could update 1000 customers in one batch instead of hitting database 1000 times.

ExternalCustomer uses the same "Address" and "ShoppingList" as a Customer, which might pose a problem in the future. In the event that a Customer or ExternalCustomer undergoes changes and no longer aligns with the Address / ShoppingList, resulting in BC-compatibility issues, it's advisable to implement an additional mapping layer between them. In case we would like to be more flexible I would use ExternalAddress and ExternalShoppingList and map them (e.g. using mapStruct) to enhance flexibility between Customer and ExternalCustomer. However, for a simple exercise like this, I opted not to make it overly complex or invest too much in future considerations.

customersync-eib's People

Contributors

cukamart avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.