in

ASP.NET Weblogs

Natty Gur

.Net from enterprise architect point of view.

August 2004 - Posts

  • FxCop rules contest.

    I won Visual Assist X (1-user license) at Codeproject (article contest) and I really don’t need it. So here is the deal, the one that will send me most of rules for FxCop (Design rules preferred) will get this Visual Assist X (1-user license). All of the rules (including their sender) will be published here.  

    I mean code that implement new ruls such as ... http://tatochip.com/archive/2004/07/19/2678.aspx

  • Enterprise Navigation mechanism.

    As every average enterprise my domain also contains many systems develop by many development tools and running on several operation systems. We’ve got Natural/Adabas applications running on MF, Java applications running on Sun and Linux machine, COM, .NET, Delphi, Magic systems running on Windows machines and SAP applications. Most of our systems running as web applications, several as client/server applications and few using virtual terminal.

    One of the challenges that we deal with lately is the user demand to be able to navigate through all enterprise systems using one navigation mechanism. From the user point of view they are dealing with one system and they want to be able to navigate backward and forward from one window to other regardless of the system that the window belongs to.

    If all systems were browser based (Intranet) it was much simpler problem. Still we need to decide if navigating from one page to another should be making on same window or new window should be open. Still some efforts need to be taken in order to find the right mechanism to navigate from one browser window to other window and backward (and keeping the last window state). But employing such a solution to systems running on browsers, virtual terminals and windows application is much more complicated. Except of the fact that navigation mechanism between browser, terminal server and widows is complicate task, most of those systems already written and can’t be change easily.

    I’ll be happy to hear any suggestions since I’m in the middle of this effort : - ). If you’re in the beginning of creating your enterprise architecture, take in account navigation since it’s one of the nightmare that you going to meet if you don’t pay attention to it from the beginning.

     


     

  • What are the main changes in IT world that will occur in the next 10 years?

    As part of the interviews, that I go through lately, I was asked to mention 3 main changes that will happen in IT field within the coming 10 years. Well here my humble opinion:

    1.  As I post already I really believe that the application presentation will take great leap forward. I'm pretty sure that today tabular views will be replaced with much more sophisticate views. Those views will use algorithms in order to show data in such away that will give the user quick insight from the data.
    2. In code business logic (sequences) as they exist today in software will disappear. Embedding fix sequences in the software cause users unable to operate the system against real life scenarios that didn’t took in account when designing the system. Therefore new concepts, such as naked objects, that enable the user to operate the system in any sequence that he want will start to take place.
    3. I know that people already say it years ago but I really think that object oriented database will start to take more substantial part in the Databases world. After all good OODB is the perfect solution for complicated systems that use Domain model to organize their model logic.
  • The visual age and architecture or who will save me from endless grid views?

    Today most of system split into layers with visual layer (UI) that responsible for formatting and displaying data to the user. Beneath UI layers responsible for application logic and data management. This concept pushes many of us to believe that visual layers are just simple formatting of data therefore can be easily recreate in each system against other system layers to show data. Right?

    Well in our world today, more and more data gathered by systems and display to the user, but it seems that the conventional data displaying as they are today reaching their limit. You saw once, for sure, user sitting in front of endless grid (that holds hundreds or millions of rows) and trying to figure out what is going on there. As I see it we are not far away from other visual solutions. For now link analysis systems already introduces other visualization methods other then data grids. I don’t know how new system visualization will be like (otherwise I probably was busy with new start-up : -) ) but I’m positive sure that systems UI layers will contain complicated algorithm that responsible for presentation aspects of the system. When system UI will hold complicated “visual logic” other systems UI layer can’t reproduce given systems UI.  Systems not rewriting other systems business logic or system data, they just using other systems layers to get data and business logic and this rule will be enforce on UI layer as well.

    So when you set system architecture I strongly recommend taking in account that system visualization, of your system or other system that you using, might be change to complicate “visual logic”. Make sure that your architecture can adopt those changing. 

  • While downsizing/rewriting legacy systems to open/newest system don’t follow legacy system design.

    Actually there are two aspects that we tend to follow when downsizing legacy system. The first aspect is business logic and the second is system design.

     

    Business logic: here I use to hear “It works perfect for the user so we duplicate it to our new system.” Although these argue sound reasonable I prefer to check up against the system bugs and requirements and to find out if maybe it’s the time to take advantage of system conversion and change system logic.

     

    Design: As with business logic, many people tend to adopt the legacy system design and just find the right way to implement their legacy design using new development tool. I just argue that using this working paradigm is completely wrong. It’s completely wrong to use PL1 / natural design while developing .Net application and the same works for VB 6 application that convert to .NET. Usually design issues and other programming task are improved or even adopt by newest development environment thus leaving old problems already solved. Don’t get me wrong. I don’t argue that every legacy system design is wrong for new systems. I just say that you better redesign and check whether legacy design feet your needs. The old design can be achieved in much simple way or even cause defects to the newest system.

     

  • Natty test for adaptive OO systems.

    This is a simple test that I use to get basic insight whether system is built on solid OO approach, and adaptive to further changes. Using those questions while interviewing system owner gives me indication about OO level of the system and system adaptively level.

    The test is based on 10 questions:

    1) Is your system class diagram contains generalization relationship (inheritance) between classes?

    2) Is your system class diagram contains Interfaces and/or abstract classes?

    3) Is your system contains configuration files holding definitions that might be use to change system sub-system and system behavior?

    4) Is your system following structure behavior pattern such as MVC?

    5) Is your system implement transaction scripts, domain model or table module?

    6) Can you add services to your business logic and data access layer classes without changing existing class’s code?

    7) Do you use design patterns in your system?

    8) Is there any use of attribute (your own implementation) in the system?

    9) Do you use any application blocks or open source projects in your system?

    10) Is your classes hold state, has few methods with few parameters and serve just one system need?

  • What about Specification?

    How many times you use third party library that implement any given task such as state machine, logging, Concurrency Utilities, etc’? Eventually you manage to find the right package for your needs and integrate it into your system. Every thing looks great until you find out that the chosen package needs to be replaced for some reason. The problem now is that you need to change your system code in order to use the new package because the new package based on other API and interfaces to interact with.

    Now if there were any Specification or Standards (like our Java brothers got) that most or even all vendors follows when they implement given solution it would be much more easy for enterprise guy, like me, to change vendors that supply other solutions for the same problem. If Specification set interfaces and API those changes could be making with minimum changes or even without any changes at all.

    Form my point of view the question is who should do it? I’m willing to give my part …

  • Entity architecture.

    There are two main architectural pattern regarding application structure. The most common one is Layer patter. Layer suggests that you will organize your code in layers which characterize certain system aspect and responsible to carry out that system character. System is building from those layers one on another while the upper layer responsible to receive incoming request (Usually User Interface - UI layer) and return results. The request is processed by calling other system layers to perform their layer specialty as part of the process. Every layer should call only layers near the calling layer, no direct calls over layers should be made. In the end of the process the upper layer return results back to the caller. The most classic separation is to 3 layers a. Presentation – responsible for receiving client request and displaying process data. B. Domain logic also known as Business logic – holds system logic. C. Data access – Retrieving and update system data.

    Another well known architecture is the Hexagonal architecture. Hexagonal take another approach to handle system domain model. Instead of well format access order with layers Hexagonal suggest many ways to get request from system outer world and obviously in different format. Request may come from user, database, test text batch file, etc'. Those requests arrives the system and receive by transformers that access model data and return request to the calling entity. This model bypasses the layer model by letting outer yet difference entities to reach system model data by transformers and without given known sequence of calls between layers. (Hexagonal model is drawn as two hexagons one in each other. Every side represents different calling type. The inner hexagon represents the model data and the space between the two hexagons represents the transformers. http://c2.com/cgi/wiki?HexagonalArchitecture ).

    I want to suggest architecture that is a mixture between those two approaches and it perfectly meets system of systems. The base assumption behind that architecture is that your IT systems are mix of Entities (systems). Each entity responsible for maintaining it own data, logic, presentation and other agreement tasks. Entity supplies it responsibilities as services to other entities and can consume those services from other entities as well. Entity architecture enable entity to interact with many sources of outer callers (rather then user) but when request intercept by given transform certain layer in the entity called. The called entity layer might use layers beneath but anyway there isn't direct access to non neighbor layer (L2 can't access L4 directly, just through L3). The layer that called by given transform is also the only layer that should return messages (results) back to the transformer. Entity architecture is similar to Hexagonal due to the fact that it enable receiving request from different sources and there isn’t rigid rule about bubbling request through all layers. On the other hand Entity use layers and enforce layers dependency therefore differ from Hexagonal architecture. From Layers point of view Entity architecture similar due to the use of layers but also differ because there might be call directly to any one of the system layers.

    Sketch of entity architecture:

    L = layer / service

    Diagram that represent SOS (system of systems). Every entity implements 3 classic layers (UI, Business Logic and Data Access). Model data encapsulate and can only be access via Data Access layer. Every one of those entity can get call transform to any layer. This model enables every entity to consume UI, BL and DA services from other entities (gray lines).

     

  • Part of page images download to machine but didn’t display.

    I saw couple of question about this issue. All the cases that I saw were connected someway to memory problems on the machine. Here's a list of possible solutions to that issue:

        1) The most common scenario is station that running Development tool, IIS, asp.net (aspnet_wp / w3wp) and optionally dllhost.exe hosting application classes. If you will close dev tool , move asp.net and IIS to other machine (running the server side application from other machine) and just operate your browser you probably see all of page images.

       2) If you working from machine that just running IE and meet this issue, simply increase IE internet temporary files cache size. Believe me it works.  

    Posted Aug 04 2004, 06:04 PM by nattYGUR with no comments
    Filed under:
  • Pluggable architecture

     

    As I mention in my previous post I'll start to post on .Net implementation of architecture patterns. This time on Pluggable :

    Name: Pluggable architecture.

    Problem:   need to add/remove classes/components from your running system dynamically without any changes to the running code.

    Context:   there are 3 conditions under which the pattern is applicable:

    1) Handle in advance situation where one of the system service components known to be replaces in the system time scale. For example certain data provider known to be replacing on system time scale and this change shouldn’t affect existing code (data provider supply by system but eventually will be supply by other system).

    2) System content in term of classes/components is unknown in advance. System content is determined dynamically in application boot start by outer configuration.

    3) Certain actions should be taken in given situation as part of application flow (events/commands). There is: a) need to add new behavior as a result of new event or given command. B) minimize the code share by several  programmers. For example code that use switch in order to handle deference commands arrived to the server. There is need to eliminate situation where several programmers update the switch code and enabling to act upon new commands.

    Forces: Pluggable architecture is solving Modularity, independence, openness and composability issues in the system. Implementation of pluggable should take in account definition of: how and where to set pluggable settings. When, where and how to read pluggable settings. How to load dynamically components/classes. Which mechanism to use in order to load different classes without changing existing code.

    Solution: Pluggable architecture is build from 6 parts:

    1) Outer configurations file which connect friendly name to class and assembly. That assembly and class should be load by the system each time friendly name is given.

    2) Parsing class to extract class and assembly by friendly name from configuration class.

    3) Cache that should hold created classes for farther uses (for performance reasons).

    4) Factory that receives friendly name and return class instance from cache or by creating new instance and store it in cache.

    5) Interface that act as the contract between the called code and implement classes.

    6) Classes that implement the contract interface and serve the given services eventually (in order to use this class, class name and assembly should be connect to friendly name inside configuration file).

    To call pluggable class an interface type variable should be declared. Creation of variable instance must be just through the factory.

    Static class diagram: this link.

    Sequence diagram: this link.     

    Class description:

    The solution is divided into 3 assemblies:

    1) PluggableInterfaces

       a. interface IPluggableDataAdapter: Holds the interface that should be implement by current and up to come pluggable classes.

    2) CustomDataProvider

       a. class DataProvider: sample data provider pluggable class that implement IPluggableDataAdapter.

    3) PluggableDemo

       a. class callingClass: simple class that demonstrate using pluggable classes.

       b. class DataAdapterFactory : use to create and return instance of pluggable class. This class implements simple cache mechanism to hold pluggable classes instance as well. If pluggable class not cache already DataAdapterFactory uses PluggableNameExtractor to get pluggable class assembly and class names, create pluggable class instance and store it into cache.

       c. class PluggableNameExtractor: extract pluggable class assembly name and full class name from configuration file.

    You can add as much as friendly name as you want to config file thus enable to set which pluggable class will be called by given friendly name. This case matches the need to minimize shared code between programmers. Instead of long switch statement all you need is just several lines that get name of service and perform it.

    Assembling application from different components is more complicated. The principle is the same but you need to create section in configuration file that holds given load classes. When system starts you can create instance for each one of those modules or use lazy load via factories to load assemblies just when they needed. This implementation is complicated due to the fact that all connections between system components should be based on contract interfaces.

    You can plug in any class that implements IPluggableDataAdapter just by changing the assembly name and class name in the configuration file for given friendly name.

    Resulting Context: to prevent performance impact cache of pluggable class should be use. In multi threaded environment consideration should be taking to prevent concurrency issues. In the demo I create new instance using reflection from cache instance. This is not recommend pattern I just use it for time constraint.

    Examples: this link points to simple demo solution for pluggable architecture.

More Posts