Code Monkey home page Code Monkey logo

clean-code-tdc's People

Contributors

psanrosa13 avatar roanbrasil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

clean-code-tdc's Issues

Sugestões

Não ficou claro para min o motivo do get(0) nessa linha de código.
Um outro ponto, o que aconteceria se o response.getComplexGroupList() estivesse vazio?
IMHO: O melhor seria se o ComplexDataStreamExample fosse mais rico e retornasse algo como getFirstGrouop

final List<Complex> complexList = response.getComplexGroupList().get(0).getComplexList();

O retorno já é um filtro é está dentro de um método privado, eu colocaria um nome mais explito o que ele faz.
Por exemplo:

.filter(byPaymentMethod(paymentMethodToSearch))

.filter(complexFilterByPaymentMethod(paymentMethodToSearch))

Vc vazou o encapsulamento aqui. Acho que seria mais semântico adicionar o pagamento e lá dentro ele define o tipo.

 payment.add(debit);

Vc só utiliza esse método uma única vez, pq não mapea para retornar o que vc quer?

    final String paymentTypeDescription = getCurrentPaymentMethod(complex);

final String paymentTypeDescription = getCurrentPaymentMethod(complex).getAttributeValue();

Eu levaria essa lógica de construção toda para dentro do débito de alguma forma, por exemplo, com um builder

Debit debit = Debit.of(paymentTypeDescription, simpleValueListFromTarget);
payment.add(debit);     

final Debit debit = new Debit();
debit.setPaymentTypeDescription(paymentTypeDescription);
simpleValueListFromTarget
.forEach(simpleValue ->
ValueType.findByName(simpleValue.getAttributeName())
.setDebit(debit, simpleValue.getAttributeValue())
);

ps: Complex mapper, confesso que senti falta do contexto, parece que é algo de pagamento, não? E se fosse PaymentDataStream? Talvez inseria um pouco de DDD e linguagem ubiqua.
Pq está muito complexo: Uma lista que mappea complexo, que retorno complexo, que tem filtro complexo.
Tá as vezes tem o simple :)

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.