fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Custom RDD 06 May 2020 12:23 #14384

  • leon-ts's Avatar

  • leon-ts

  • Topic Author


  • Posts: 118
  • Hi,

    I am starting to transport the custom driver that we in our team developed to simulate the operation of RDD DBFCDX with MS SQL. This driver fully imitates the operation of DBFCDX, but with the database on a SQL Server. XSharp has a different approach to writing RDD than VO. I see that I need to rewrite my RDD to a class. The question is: from which class do I need to inherit my class?

    Best regards,
    Leonid

    Please Log in or Create an account to join the conversation.

    Custom RDD 06 May 2020 12:32 #14385

  • robert's Avatar

  • robert


  • Posts: 1846
  • Leonid,
    You don't really need to inherit from a class as long as your class implements XSharp.RDD.IRdd.
    But you may want to inherit from XSharp.RDD.Workarea.
    See github.com/X-Sharp/XSharpPublic/blob/fea...ore/RDD/Workarea.prg .
    This class has some properties and method implementations that you may want to use.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Custom RDD 06 May 2020 12:49 #14387

  • leon-ts's Avatar

  • leon-ts

  • Topic Author


  • Posts: 118
  • Robert, thanks for the tip!

    In RDD for VO, there are common functions that do not directly depend on DBFCDX, and we did not program their implementation, but left the default implementation from Host RDD. Therefore, in XSharp, I need to inherit my class from some class that already has a basic common implementation. I will look at XSharp.RDD.Workarea. Thanks!

    Best regards,
    Leonid

    Please Log in or Create an account to join the conversation.

    Custom RDD 18 May 2020 10:57 #14631

  • leon-ts's Avatar

  • leon-ts

  • Topic Author


  • Posts: 118
  • Hi to all,

    Is there any point in XSharp (as opposed to VO) passing an RddList list to UseArea instead of a single name, such as "DBFCDX"?

    In VO for DBFCDX, we passed a list of three elements based on the following hierarchy:
    CAVODBF
    _DBFCDX
    DBFCDX

    I looked at the Runtime sources in XSharpPublic and didn’t understand if this makes any sense now?

    Also, my colleague conducted an experiment in XSharp with passing only "DBFCDX" strings to UseArea instead of RddList (with three names, as in VO), and it worked great.

    Best regards,
    Leonid

    Please Log in or Create an account to join the conversation.

    Custom RDD 18 May 2020 16:10 #14636

  • robert's Avatar

  • robert


  • Posts: 1846
  • Leonid,

    The RDDList is no longer required (but supported).

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Custom RDD 18 May 2020 16:25 #14637

  • leon-ts's Avatar

  • leon-ts

  • Topic Author


  • Posts: 118
  • Robert,

    Thanks for info!

    Best regards,
    Leonid

    Please Log in or Create an account to join the conversation.

    Custom RDD 29 May 2020 11:02 #14754

  • leon-ts's Avatar

  • leon-ts

  • Topic Author


  • Posts: 118
  • Robert,

    I am almost finishing transporting my SqlRdd from VO to XSharp. At your advice, I inherited it from the Workarea class, which implements the basic functionality (it was also in VO). But it bothers me that some members of the Workarea class, which by their nature must be protected, are public. For example: _Area, _FileName, _Fields, _BoF, _EoF, etc. (in principle, all members whose name begins with an underscore). It is correct? Indeed, in this way these members can be changed externally, which violates the logic of the driver.

    Best regards,
    Leonid

    Please Log in or Create an account to join the conversation.

    Custom RDD 29 May 2020 17:34 #14756

  • leon-ts's Avatar

  • leon-ts

  • Topic Author


  • Posts: 118
  • Addition:

    In the IRdd interface and in the Workarea class in the Lock() method, a typo is possible in the name of the uiMode parameter (copy/paste from the previous HeaderLock method).
    METHOD Lock(uiMode REF DbLockInfo) AS LOGIC
    Most likely, it should have a name not uiMode, but lockInfo (this is the name of this parameter in your DBF class).

    Best regards,
    Leonid

    Please Log in or Create an account to join the conversation.

    Last edit: by leon-ts.

    Custom RDD 29 May 2020 20:34 #14759

  • robert's Avatar

  • robert


  • Posts: 1846
  • Leonid,
    Thanks for your remarks.
    I will rename the parameter in the Lock method.
    The fields were made public for simplicity, but you are right they should probably be replaced with properties, maybe with a public getter and a private or protected setter.
    I can do that for the next build, but that will also require you to change your code.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Last edit: by robert.

    Custom RDD 29 May 2020 20:51 #14760

  • leon-ts's Avatar

  • leon-ts

  • Topic Author


  • Posts: 118
  • Robert, thanks!

    It will be great if the mentioned members of the Workarea class have an access modifier - protected. In this case, derived classes such as DBFCDX, DBFNTX and so on, including my SqlRdd, will have direct access to them without a setter layer. This will provide good performance and at the same time close access to them from the outside.

    Best regards,
    Leonid

    Please Log in or Create an account to join the conversation.

    Last edit: by leon-ts.
    • Page:
    • 1