ITeye博客

2010 年文章归档

共 25 篇文章

.Net应用程序的运行过程

当运行一个.NET应用程序时,OS会先建立一个进程,检查PE文件,执行PE文件中的.text段中的code, 在托管程序编译时,.text段里面增加了一条JMP_CorExeMain或JMP_CorDllMain指令(根据是exe文件还是dll文件不同)。若是非托管程序,就进入到入口函数了,若是托管程序就会跳入到另一个函数中。这个函数在一个叫做MSCorEE.dll的动态链接库文件中,当安装了.net框架时就会被复制在系统目录下。系统会根据托管程序PE文件中的信息找到这个DLL,然后通过MSCorEE.dll的PE文件信息找到这个_CorExeMain函数的入口地址,然后修改刚才的JMP指令…

2010-08-14 22:56 · Essential.NET · 工作 · OS · .net · 框架

.NET程序集导入过程

.NET程序集导入过程分为两个部分,一个是通过Assembly Resolver找到程序集,随后通过Assembly Loader将其导入。 Assembly Resolver 首先运用Version Policies来确定最终的程序集版本。Version Policy可以在三个级别指定,分别是应用程序级别,组件级别和machine级别。每一级都可以通过bindingRedirect将版本重定向,且低级的输出是高级的输入。当Assembly Resolver决定哪一个版本将会被导入后,将定位到确切的程序集文件。首先在Global assembly cache里查找(assemly name必…

2010-08-14 21:59 · Essential.NET · Cache · .net

Database Change Notification

Database Change Notification is a feature that enables client applications to register queries with the database and receive notifications in response to DML or DDL changes on the objects associated with the queries. The notifications are published by the database when the DML or DDL transaction co…

2010-08-06 14:21 · Database · performance · Oracle

第三步 确定将如何分布层次和组件(完)

你应该只有在需要的时候才将层和组件分布到不同的物理级上去。分布式部署的通常原因包括安全策略,物理限制,共享的业务逻辑和可测量性。 在Web应用系统中,如果你的表示组件以同步方式访问你的业务组件,考虑将业务层和表示层的组件部署到同一个物理级上去以获得最大的性能和简易的操作管理,除非安全限制两层之间需要有一个可信边界。 在胖客户端应用系统中,UI处理在客户端,出于安全和简易的操作管理方面的考虑,你可能会倾向于将业务组件部署到一个独立的物理级上。 将业务实体部署到与使用这些业务实体的代码相同的物理级上。这将意味着可能将他们部署到多个地方;将数据实体副本部署到其中的程序逻辑使用了或引用了这些数据实体…

2010-07-15 22:06 · Application Architecture · 工作 · UI · Web

第二步 决定你需要哪些层次(完)

有很多不同的方式可将功能相关的组件划分到同一层中。在业务系统中最通常的方式就是将表示,服务,业务和数据访问功能拆分到不同的层中。还有些应用系统同时包含报表,管理或基础架构层。 要小心地增加额外的层,如果这些层不能为相关的一些组件提供一个逻辑组,从而为你的应用系统增加可维护性,可量测性或可适应性,那么就不要增加它们。例如,如果你的应用系统不发布服务,那么一个独立的服务层将不需要,这时仅仅需要表示层,业务层和数据访问层就可。

2010-07-15 21:31 · Application Architecture

Types at Runtime

Every object in the CLR begins with a fixed-size object header. The Object header has two fields. The first field of the object header is the sync block index. The second field of the object header is a handler to an opaque data structure that represents the object’s type. Every instance of a given…

2010-06-28 17:11 · Essential.NET

Types and Base Types

Non-interface types that do not specify a base type get System.Object as their base type. Declare a type as sealed prohibits the use of the type as a base type. Declareing a type as abstract, on the other hand, disallows direct instantiation of the type and makes it useful only as a base type. The …

2010-06-25 10:38 · Essential.NET

Type Fundamentals

There are three fundamental kind of type members: fields, methods and nested types. The field of a type control how memory is allocated. The CLR will allocate memory for static field once: when the type is first load. The CLR will allocate memory for non-static(instance) fields each time it allocat…

2010-06-25 10:37 · Essential.NET · C · C++ · C#

设计分层架构的步骤(续二)

选择你的分层策略(完) 如果是逻辑分层,相互交互的层将会部署到同一个物理级上并且在同一个进程中运行,这样你就可以充分利用高性能的交互机制,比如通过组件接口直接调用。然而,为了维护逻辑分层的优点和将来的可适应性,你必须小心地维护层间的封装和松耦合。 对那些逻辑层被部署到分离的物理级上的情况,相邻层间的通信将经由链接的网络发生,并且你必须确保你选择的设计能支持通信延时,且是松散耦合的。 决定你应用系统的哪些层被部署到分离的物理级上,哪些被部署到同一物理级上也是你分层策略中一个重要部分。为了维护可适应性,总是要确保层间的交互是松散耦合的。这将使你能够利用将层部署到同一级上时具有高性能,同时也允许你…

2010-06-06 16:13 · Application Architecture · 网络应用

Types and Base Types

Declareing a type as sealed prohibits the use of the types as base type. Declaring a type as abstract, on the other hand, disallow direct instantiation of the type and make it useful only as a base type. The policy for dealing with collisions when method names or member names are reused is somewhat…

2010-06-05 12:17 · C · C++ · C#

Types and Interfaces

Interface is just another type of the CLR. Interfaces can have members, with the restriction that an interface cannot have instance fields nor instance methods with implementation. One can view interfaces as partitioning the set of all possible objects into subsets. Which subsets an object belongs …

2010-06-05 11:01 · Essential.NET · Access

Types and Initialization

Types are allowed to provided a distinguished method that is called when the type is first initialized. This type initializer is simply a static method with a well-known name(.cctor). A type can have at most one type initializer, and it must take no parameters and return no value. It is called auto…

2010-06-05 10:19 · Essential.NET · C · C++ · C#

Architectural Guidance for Composite Smart Clients

Outlining the Development Process First requirement analysis, overall user case Overall Shell-design Shell implementation and tests Infrastructure services implementation and tests Use Case Analysis Overall WorkItem design Use Case refinement Final WorkItems design and packaging WorkItem implementa…

2010-06-04 11:26 · Go · UI · Security

设计分层架构的步骤(续)

一. 选择你的分层策略 (未完) 分层就是将应用系统的每个组件逻辑地划分为一个个有着特定角色和特定功能的组。使用分层的形式能够增加你应用系统的可维护性,并且在需要性能调优时能更方便地扩展。有很多种不同的方式将相关的功能划分到层里。然而,划分的层数太多或太少会增加不必要的复杂性。决定适合你应用系统的分层粒度是选择分层策略中的关键的第一步。 你必须同时也考虑到你分层的目的是仅仅为了将功能进行逻辑拆分,还是也为了可能的物理分级。层间边界交互会增加本地性能开销,特别是组件间的边界交互是物理远程交互。然而,你应用系统在可扩展性和可适应性方面的增加带来的好处会足以超过这些性能开销。另外,分层可以使得对某…

2010-05-14 17:09 · Application Architecture · Microsoft

Run out of Temporary tablspace

Once I encounter a problem that the used space of temporary tablespace always increases till out of space on production environment, an “ORA-1652: unable to extend temp segment” error rises at last which causes the application crashed. Later restart application server, the used space releases immed…

2010-05-13 17:38 · C · SQL Server · C++ · C# · SQL

设计分层架构的步骤(一)

开始设计应用系统时,你的第一个任务就是处于最抽象级别之上将功能划分到各层里。接下来,你必须依据你设计的应用系统的类型为每一层定义公共接口。一旦你定义好了分层和接口,你必须决定应用系统将如何部署。最后,你需要选择应用系统的各逻辑层间、物理级间的交互所使用的通信机制。尽管你设计的分层结构和接口可能会随着时间不断变化,特别是你使用敏捷开发时尤其如此,但这些步骤会确保你在开发过程的早期就在某些重要的方面有所考虑。典型的设计步骤如下: 1. 选择你的分层策略 2. 决定你需要的层次有哪些 3. 确定将如何分布层次和组件 4. 决定你是否需要合并某些层次 5. 确定层间交互的规则 6. 识别出横跨层间的…

2010-05-12 17:01 · Application Architecture · 企业应用 · 敏捷开发 · Microsoft · 设计模式

基于逻辑分层的设计

不论你设计的应用系统是何类型的,是否有用户界面或是只是一个提供服务的服务程序(请不要将此服务与应用系统的服务层混淆),你都可以将应用系统设计成为基于软件组件来分组的逻辑组集。这些逻辑组就叫做层。分层有助于区分不同的由这些软件组件提供的功能的类型,从而使得做出一个能够具有高可复用这些软件组件的设计变得更为简单。每一个逻辑层可包含多个不同的组件类型,且具有相同类型的组件可再被划分为一个个子层,每个子层都展现着特定功能的类型。 通过标识出存在于大多数系统中的通用组件的类型,你可以构造出应用程序或服务的分层映射,然后使用此映射来作为你设计的蓝图。将应用系统分成具有特定角色和功能的层有助于最大化地增加…

2010-05-11 18:08 · Application Architecture · 工作 · Microsoft

Convert Date with Time Zone

On occasion giving a date time with a time zone, we want to get the date time under another time zone, how to do it? Here gives a solution: FUNCTION fun_exchange_timestamp_tz(pv_timestamp TIMESTAMP, pv_from_tz VARCHAR2, pv_to_tz VARCHAR2) RETURN TIMESTAMP WITH TIME ZONE AS BEGIN IF pv_timestamp IS …

2010-05-11 15:31 · Exchange

String Split

On occasion we need split and treat a single comma-delimited value as if it were a column in a table. There are two methods to achieve this. 1. TABLE SQL function We can take advantage of the TABLE SQL function and PL/SQL function to do this. Example: CREATE OR REPLACE TYPE GTYP_STR_TABLE IS TABLE …

2010-05-10 16:52 · HTML · C · C++ · SQL · Oracle

String Aggregation

In some cases, it is necessary to aggregate data from number of rows into a single row, giving a list of data associated with a specific value. There are some methods to achieve this. LISTAGG Analystic Function in 11g Release 2 The LISTAGG analytic function was introduced in Oracle 11g Release 2, m…

2010-05-07 19:14 · SQL · performance · Oracle