문제

Most developers will acknowledge how implementing crosscutting concerns such as logging, auditing, security and transactionality can adversely affect business logic implementation. Such concerns "seem" to increase the complexity of existing business logic, at times making it difficult if not impossible to clearly distinguish business logic from the crosscutting concern implementation.

How does Dart deal with this? If it doesn't currently have any mechanism to address this issue, are there plans to introduce a way to implement cross-cutting concerns?

Thanks.

도움이 되었습니까?

해결책

Not really sure what's being asked here; but using Transformers you can rewrite code (this is how dart2js and Polymer work). It won't allow you to change any syntax, however.

You could, for example, write a transformer that detected an @log annotation and then inject code to log that the method was called. Or you could create a @protected annotation and inject permission-checking code.

Other than transformers, I don't believe there's anything built-in; but I do suspect they'll add a lot of flexibility in this area.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top