Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Classes as data sources

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Classes as data sources

    This is a spin off of the question about CLR.

    I have long wondered if there is a way to use classes with the .Net namespace to create business objects that are data sources for A5 v11. This was a common practice for me in when using VB.Net. I liked it because it made the object reusable and easy to troubleshoot and maintain. I just don't see how I can to a similar thing in A5. Have I missed something? So far as I can find, I must use a table/set and not a dataset/recordset returned by a data class.

    If you cannot do this, it does seem like this is a missed feature. To be able to work with classes in either xBasic or within the .Net framework namespace, in this way, would be a nice/huge addition.
    Regards,

    John W.
    www.CustomReportWriters.net

  • #2
    Re: Classes as data sources

    Hi John

    I think this might be what you are looking for.

    http://wiki.alphasoftware.com/Genera...romWSDL+Method

    Hope it helps, it's all a mystery to me.

    Paul

    Comment


    • #3
      Re: Classes as data sources

      Paul -
      Thanks for the response, but its not quite what I am after, I am looking for something different. Classes are objects like a table or a layout is an object. If A5 could use classes as a data source in lieu of tables it would be cool. It allows me to create a logic layer filled with reusable objects/classes. I could for example create a single data class that would handle every type of data transaction with customers. I could have do a all my CRUD stuff in one place, plus more. Once my class is built I can instantiate/reference the class and then work with it and its properties, functions and subs. It will give me a form of code completion, consistency, etc. It may seem a lot of extra work, but the reward is over time. If I need to make a change because something in the database has changed. I make the modification in the class and its done. I don't about changing a query or filter in place it exists in my app that is impacted by the change. This is only the beginning... but right now it must not be possible or someone from Alpha would surely have mentioned it could be done.

      Just thinking out loud, as the saying goes.
      Regards,

      John W.
      www.CustomReportWriters.net

      Comment


      • #4
        Re: Classes as data sources

        Hmm. Thinking a little bit down your line of thought John, it seems necessary to begin with the difference between Alpha Five and any OO-oriented language. Which is of course, that Alpha Five is build on xbasic, which delivers a rather linear programming method, as opposed to the .Net method which implements Object Oriented programming by which you programm with objects and instances of classes. This difference in basic thinking makes it very hard to "use" Alpha to create something near OO.

        Second thing to mention is, that objects are entities used in OO-based software to represent a particular part of the system. Since the presence of data in an object is only an implementation technique, one could say that the Alpha Five table and sets are somewhat comparable with Objects.

        Third thing to mention would be, that classes are abstract descriptions of sets of objects, used to contain the descriptions of the behavior of the objects it represents. Hence, you could see the Alpha UDF (...maybe.... in some way....) as a class.

        Now, it's your turn again John....

        Comment


        • #5
          Re: Classes as data sources

          Data Model Binding - dynamic classes connection makes for “unbreakable” development. Because everything is so closely tied to the model and the business logic – the datastore classes, the methods, etc. – each part is synchronized with the other. If you change the behavior of a class or an attribute, it will automatically be reflected everywhere. Each connection carries all of its inherent logic with it, so when you update the back end, you won’t have to redo your front end, and vice versa.

          Look guys, I can write hieroglyphics too...

          Paul

          Comment


          • #6
            Re: Classes as data sources

            You don't need to if you use UDF's as well.... hieroglyphics or not is all a matter of perspective, isn't it?

            Comment


            • #7
              Re: Classes as data sources

              Marcel - I know that operationally A5 gets the job done. I also understand UDF's are out there. In the end the argument is why even do object oriented programming but that is an old argument. But let's face it object oriented programming is not a new idea. Classes are just one part of the object list. If we go back to VB6 few people worked with classes, generally they liked to stuff everything went into the Main Module and I do mean everything. Maintenance could easily become a nightmare; it often was ugly out there, but it worked.

              Classes, which I believe can be overdone, helped sort out that messiness. Somebody changes a datatype or wants to change a datatype, easily done at one spot. Look I know I talking to someone who has worked with objects and classes. In the past I found them to be a convenient clean way to layout and implement an app. Necessary no, but do they add a nice layer of functionality and ease of maintenance...to my way of thinking yes. It can move us from client - server to n - tier apps.

              Now personally, I would like to see you arguing for the ability to use business objects (data classes) as data sources for A5 apps! :)

              A5 as an object oriented development system, that can run on CLR would perhaps be the game changer and moving us/it to compete with the other OO development systems.

              Still just thinking out loud about this and that...
              Regards,

              John W.
              www.CustomReportWriters.net

              Comment


              • #8
                Re: Classes as data sources

                Not being a programmer tutored in modern tech speak, I will try and outline what I understand classes to be in my own particular parlance.
                In my previous development environment we had a thing called a type repository or dictionary. Here we could create instances for any field data type, for example I might create a type that I call datetype I could define the type as date and specify a wide range of characteristics (type properties) for it. I could do such things as allocate an input format for example 'DD/MM/YYYY' and I could attach programs to it's possible events such as 'on click'. This on click event might invoke a date picker program or it might call a table look up showing unique date entries in the table associated with that program, or whatever. Other events such as 'on form save' might run a batch program to perform a date calculation of some sort and update a system-wide (global) variable, etc. Very similar to field rules but more far ranging.
                At the time of describing tables you could specify these types instead of conventional field types. You could then alter specific aspects of the resulting inherited field properties should you wish to. Doing this however would exclude the modified field from being globally changed if in the type repository the original datetype was changed for example to have an input format of 'YYYY/MM/DD' instead. Having made a change to the type all relevant tables with non-changed fields referenced as datetype would be changed automatically throughout the project\solution, relevant data would be converted if necessary and all related forms, browses, reports and batch processing routines (Xbasic scripts in Alpha) would all be modified to take into account the cosmetic changes made.
                Likewise, if the example date field that was changed from it's original inheritance features at table level was again subsequently changed then as with the types all related forms, etc. would be changed for the modified field in the same way as a modified type.
                Everything was cross referenced by where and how used and by make-up attributes as well as by reference name. A sort of programming genome.
                Of course Alpha has field types and sets which are useful but nothing that gives you the power of this global modification.
                I hope that makes sense. I know it is slightly off-topic in respect of John's original post but I would love to see something like this in Alpha.
                Sorry, if my terminology is a bit whacky...
                You may of course wonder why I changed from EDeveloper to Alpha - Well that is another story - At times I still wonder...
                Paul
                Last edited by pulsoft; 12-12-2012, 06:16 PM. Reason: Trying to clarify what I wished to convey

                Comment


                • #9
                  Re: Classes as data sources

                  John, I agree with you that it would be great should Alpha Five as a whole be able to seamlessly communicate with the .NET platform. That, however, ain't gonna happen any time soon. And although you COULD mimic the methodology of Classes and Objects by using User Defined Functions (that is why I mentioned it of course) this would be like learning a Chinese person the sounds of some German words: he could be able to use it but would not understand a word of what he was saying. The syntax of the languages differ too much.

                  I agree with you on a lot of points. If you are proficient with Alpha, I see no particular reason why .NET would be "better". That is of course reasoning besides the matter of .NET being the defacto market standard, which whatever we think about it IS a big issue.

                  Would one think more "efficiently", I mean, in terms of how to take advantage of the "positives" of .NET whilst using Alpha Five, then one could program core functions in UDF's and call upon them from anywhere you need: this comes close to the class instance when you are flexible enough with the UDF parameters.

                  There is a lot hidden in UDF's. As in all of Alpha Five, there is far more to enjoy then the most of us will ever know. For instance take xdialog. It is a world of its own. Some of the Alpha specialists are very proficient with it, like Daniel Weiss. If you start studying xdialog, you will get surprised by its power.

                  At the base of taking good use of all of this is "thinking" and "debating" about, like you do in this thread. It is a good thing.

                  Comment


                  • #10
                    Re: Classes as data sources

                    Paul
                    I read through your post a couple of times. In my way of thinking we take and wrap that functionality into a an object and call it a a class. In your case this could be called dataType and in that you could have a function that format your date. You could call it DateFormat. You would design it so you would pass the value you want formatted into it. You could then call that by something like dataType.DateFormat(date) and it would return the date formatted as you want it.

                    I realize this can be done by some built in date functions or by a field rule if its a single date. But by using a class, say you want to change the format, you go into the class make the change and its done throughout the entire application. Now you don't have to go to every place the date is located and convert it.

                    Again, I appreciate that A5 has the means to do some of these things but that is not the point. The point is moving the model from what Marcel called a linear type of coding to an object model of application development.

                    Just thinking out loud again, a dangerous thing for me to do. I always end up in trouble
                    Regards,

                    John W.
                    www.CustomReportWriters.net

                    Comment


                    • #11
                      Re: Classes as data sources

                      I use Alpha v11 classes as base elements to all my webpages.

                      Every new page is a new instance of base class. The base class has inside the layout (header, footer, main menu...). and xbasic template for html and class properties and functions which are similar to all pages

                      If I change something in my base class all my pages will change. Very nice and clean.

                      When I then create a new basic a5w page it is just 9 line of xbasic code.

                      Comment


                      • #12
                        Re: Classes as data sources

                        Ken - its nice to hear someone using Alpha is making use of classes. Thanks for the post.
                        Regards,

                        John W.
                        www.CustomReportWriters.net

                        Comment

                        Working...
                        X