From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,9b75d36fda92b3ba X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g43g2000cwa.googlegroups.com!not-for-mail From: "John" Newsgroups: comp.lang.ada Subject: Re: Using Ada (or SPARK) in Ada-unaware environment Date: 19 Jan 2006 16:50:49 -0800 Organization: http://groups.google.com Message-ID: <1137718249.572448.40990@g43g2000cwa.googlegroups.com> References: NNTP-Posting-Host: 66.81.68.118 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1137718254 28256 127.0.0.1 (20 Jan 2006 00:50:54 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 20 Jan 2006 00:50:54 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g43g2000cwa.googlegroups.com; posting-host=66.81.68.118; posting-account=SN40OAwAAABM_rISntbjsmd9hGuJXrzP Xref: g2news1.google.com comp.lang.ada:2553 Date: 2006-01-19T16:50:49-08:00 List-Id: I have a suggestion that might serve your control system that you propose to implement in Ada. The suggestion builds on your option #1 to import interfaces from C and to write device controls in Ada. I have an experience that suggests you might divide that scheme into two levels of abstraction. Write "thin" bindings to the hardware vendors' C libraries and capture these into a class of object whose interface encapsulates the capabilities of the hardware. Let me call this class "controller". For example, there might be a controller that implements a particular brand of motor and lets its user move clockwise or counterclockwise at some speed, for a specific number of revolutions. Write another layer of abstraction (in Ada) that presents an interface to the control system. Let me call this class "device". An example might be an actuator device that moves a cart to some position, or a mirror to some angle. The device's specification represents the needs of the control system. Implement the device's actions by invocations of the controller. Consider the benefits of this scheme: - Vendor's C library is completely encapsulated; - A device can be "upgraded" by replacing the controller with a new model, and the control system is unaffected; - Data that characterize the hardware is separated from the data that the control system presents to its user. - Composite devices can be built. For example two-axis motions built of two separate controllers; Here are a couple references to reports of a very large control system that uses this strategy: Fong et al., "Application Software Structures Enable NIF Operations," ICALEPCS 2001. Lagin et al., "The Overview of the National Ignition Facility Distributed Computer Control System", ICALEPCS 2001. Both are at: http://accelconf.web.cern.ch/accelconf/ica01/proceedings Carey et al. "The National Ignition Facility: Early Operational Experience with a Large Ada Control System" in SigAda 2002.