Giter VIP home page Giter VIP logo

Comments (4)

Second-dimension avatar Second-dimension commented on May 12, 2024 3

我觉得这就是一个很简单的封装**,定义了注册feign客户端扫包的包名,让整个框架保持统一风格,并且pig还提供生成脚手架的archetype,避免了不必要的麻烦。

一处定义跟处处定义哪个比较好

image

from pig.

lltx avatar lltx commented on May 12, 2024
    1. 本人有代码洁癖

请注意代码的 https://github.com/pig-mesh/pig/blob/master/pig-common/pig-common-feign/src/main/java/com/pig4cloud/pig/common/feign/annotation/EnablePigFeignClients.java#L54

这里指定了整个框架的 扫描范围, 不需要 每个 Main 上边都是这种 @@EnableFeignClients("com.pig4cloug.xx.xxx")

你不觉着代码很丑?

    1. common-feign 模块同样支持 spi 的注入, 通过我们文档提供的 pig-gen 的archetype 你就完全不需要去考虑什么扫描范围
      约定大于配置
    1. 通过上述两种形式,可以避免同包、不同包的扫描问题和排错问题

from pig.

ChunMengLu avatar ChunMengLu commented on May 12, 2024

这种方式统一了框架的规范和行为,避免不同开发同学照成不同配置,减少团队协作的成本,提高代码质量。

对于新手有疑问很好,可以交流,很多事情都有不同的考虑角度。

from pig.

lltx avatar lltx commented on May 12, 2024

这是一个开源项目,我们非常欢迎您的贡献和加入,无论是微不足道的清理或大的新功能。

https://www.yuque.com/pig4cloud/pig/lceu0v

from pig.

Related Issues (20)

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.