我们如何跨层传递GUID字符串? [英] how can we pass GUID string across layers?

查看:88
本文介绍了我们如何跨层传递GUID字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何跨层传递GUID字符串?

我需要他在所有层上传递GUID(它可以是逻辑的也可以是物理的),以便我可以将GUID与跟踪输出一起添加并发送到日志文件.以后对我来说,分隔该特定GUID(页面请求)的详细信息将很有用.

how can we pass GUID string across layers?

I need he pass the GUID across all layers( it may be both logical or physical) so that I can add the GUID with the trace output and send to log file. And later it will be useful for me to segregate the details of that specific GUID (page request)

推荐答案

将其作为字符串传递:rolleyes:
Pass it as a string :rolleyes:


We can create a global variable inside the classes  to  hold the GUID.This global variable can be initialized through class constructor when the class object is created inside the upper layer or sending GUID in method signature  .
but this requires lot of code change which is not feasible for a stable system.

Please let me know if we can pass guids from 1 layer to another without affecting class definitions and function signatures?
can we use Aspect oriented programming here?


这篇关于我们如何跨层传递GUID字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆