https://www.wikiwand.com/en/Silk
https://zh.wikipedia.org/zh-tw/%E8%9A%95
https://www.fibre2fashion.com/industry-article/5734/effect-of-selected-pretreatments-on-properties-of-oak-tasar-silk-fabric
https://www.wikiwand.com/en/Silk
https://zh.wikipedia.org/zh-tw/%E8%9A%95
https://www.fibre2fashion.com/industry-article/5734/effect-of-selected-pretreatments-on-properties-of-oak-tasar-silk-fabric
https://github.com/gbegreg/GBE3D
https://play.google.com/store/apps/details?id=fr.gbesoft.FMXFPS&hl=en_CA&gl=FR
https://www.fmxuniversity.com/
https://github.com/dimsa/ShadowEngine
https://fireblazefmx.wordpress.com/
Нововведения по версиям Delphi [Love Soft]
http://xlench.bget.ru/doku.php/delphi/classes/new-comps
https://github.com/WilliCommer/ArrayHelper
Burn hex file into 8051 AT89S52 | Progisp
AT89S52 https://www.microchip.com/en-us/product/AT89S52
https://www.microchip.com/en-us/products/microcontrollers-and-microprocessors/8-bit-mcus/8051-mcus
201206231551簡易型 8051 燒錄器
AT89S52 and ISP Programming | Forum for Electronics
https://www.edaboard.com › threads › at...
the whole circuit should have regulated 5V, so using 7805 should be OK. You still though need Q1 as the Vcc switch .. 2)11MHz clockl will be ...
AT89C51IC2 Datasheet - Microchip Technology
https://ww1.microchip.com › DeviceDoc › doc4301
PDF
face, a 2-wire interface, an SPI Interface, a more versatile serial channel ... P1.5/CEX2/MISO. P1.6/CEX3/SCK. P1.7/CEx4/MOSI. RST. P3.0/RxD. PI2.1/SDA.
8-bit Flash Microcontroller with 64K bytes Program Memory ...
https://ww1.microchip.com › downloads › DeviceDoc
PDF
should be soldered to ground. NOTE: † SPI in remap mode. ‡ AT89LP51ID2 Only. (†MOSI/CEX2/MISO) P1.5. (†MISO/CEX3/SCK) P1.6. (†SCK/CEX4/MOSI) P1.7. (DCL) RST.
https://microcontrollerslab.com/at89s52-8-bit-microcontroller-pinout-programming-features-applications/
https://electronics.stackexchange.com/questions/24824/mosi-and-miso-at-89s52
https://www.pjrc.com/tech/8051/
Atmel 8051 Microcontrollers Hardware Manual
Pin diagram of 8051 Microcontroller - GeeksforGeeks
https://www.geeksforgeeks.org › pin-diag...
During flash programming i.e. Programming of EPROM, this pin acts as program pulse input (PROG). Pin 31 (EA/ VPP) – EA stands for External ...
The 8051 Microcontroller and Embedded Systems Using ...
https://www.academia.edu › The_8051_...
The 8051 microcontroller and embedded systems using assembly and c 2nd ed by ... 10 8051 31 11(8031)30 -EA/VPP ALE/PROG must be programmed (INT0)P3.2 12 29 ...
https://www.edaboard.com/threads/sofitech-willar-sp200s-atmel-8051-microcontroller-diy-programming-kit.254117/
https://www.cybermedian.com/id/top-30-best-uml-modeling-software-2022/
Top 30 Best UML Modeling Software [2022]
Visual Paradigm (Desktop) https://www.visual-paradigm.com/
Visual Paradigm (Online) https://online.visual-paradigm.com/
StarUML open source https://staruml.io/
Diagrams.net https://www.diagrams.net/
Cacoo https://cacoo.com/
Microsoft Visio
Moqups online https://moqups.com
Altova https://www.altova.com/umodel
Umple https://cruise.umple.org/umple/
UMLetino open source https://www.umletino.com/
Astah https://astah.net/
BOUML https://www.bouml.fr/
SketchBoard https://sketchboard.io/
yUML https://yuml.me/ https://www.dokuwiki.org/plugin:yuml
Violet UML Editor open source https://sourceforge.net/projects/violet/
https://gitmind.com/
https://www.softwareideas.net/
http://dia-installer.de/
Modelio Open Source https://www.modelio.org/
Systems Design Rhapsody
Open ModelSphere
Diagramo
GenMyModel
WhiteStarUML
Umbrello
PlantUML
ArgoUML
NClass
UMLet
Unified Modeling Language diagrams
https://en.wikipedia.org/wiki/List_of_Unified_Modeling_Language_tools
https://en.wikipedia.org/wiki/Unified_Modeling_Language
https://en.wikipedia.org/wiki/Glossary_of_Unified_Modeling_Language_terms
https://en.wikipedia.org/wiki/Category:UML_tools
https://en.wikipedia.org/wiki/UML_tool
https://en.wikipedia.org/wiki/Applications_of_UML
https://github.com/grijjy/DelphiDuktape
https://duktape.org/index.html
https://en.wikipedia.org/wiki/List_of_ECMAScript_engines
https://www.elektormagazine.com/labs/usb-hid-test
https://www.sonelec-musique.com/logiciels_freewares_usbhidtest.html
https://github.com/LongDirtyAnimAlf/FPC-USB-HID
https://forum.lazarus.freepascal.org/index.php/topic,49233.0.html
https://github.com/LongDirtyAnimAlf/Delphi-Android-USB-HID/blob/master/android.hardware.usb.HID.pas
https://github.com/project-jedi/jvcl/blob/master/jvcl/run/JvHidControllerClass.pas
https://stackoverflow.com/questions/6271421/using-hidcontroller-on-delphi-2010
https://torry.net/pages.php?id=208
https://blogs.embarcadero.com/human-interface-devices-communicator-for-delphi-c-builder-on-windows/
https://winsoft.sk/nathid.htm
https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/
https://www.elektormagazine.com/news/softstartforamplifiers
Safety Relay protect Relay protection circuit surge voltage Suppression Power-Back Surge Protection Circuit Surge Protection Circuit
https://www.eeweb.com/relay-coil-energy-saver/
https://dmohankumar.wordpress.com/2012/10/02/timer-relay-design-trick-16/
24v 3a power supply circuit protection coil speaker
protection coil speaker counter emf Electricity Regulations
https://sound-au.com/project33.htm
https://sound-au.com/project33.htm
Loudspeaker Protection and Muting
Relay Specifications
Electricity Regulations EMSD
Relay Flyback Voltages
Flyback Voltage With Diode+Zener
https://sound-au.com/articles/relays.htm
https://sound-au.com/project33.htm
SCR RELAYS Elektor Magazine circuit manazine relay flyback zener
Relay Channel Way Output Module Board
SCR RELAYS Elektor Magazine circuit manazine relay flyback zener 10 Relay Channel Way Output Module Board
optocoupler isolation 5A DC board NPN PNP SCR rail installation
https://j-integra.intrinsyc.com/support/com/doc/ias/delphi.html
https://j-integra.intrinsyc.com/support/com/doc/ias/
https://www.simis.io/index.html#Products_Ashes_Download
Ashes - Creating an airfoil and adding aerodynamic coefficients with multiple Reynolds numbers
https://en.wikipedia.org/wiki/Wing
The Aerodynamics of V/STOL Aircraft - DTIC
stol aerodynamic airfoil Computational Fluid Dynamics
https://www.researchgate.net/publication/348457909_Experimental_research_of_active_vibration_and_noise_control_of_electrically_controlled_rotor
https://www.pinterest.com/waysuj/aerodynamics/
https://hackaday.com/2020/07/11/aerodynamics-for-dummies/
https://www.avweb.com/aviation-news/faa-proposes-second-fine-on-boeing-over-faulty-slat-tracks/
https://www.kitplanes.com/super-cub-kit-comparison/
https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.TObject.MethodAddress
https://github.com/ibv/LDAP-Admin/blob/master/Source/Script.pas
https://github.com/Kryuski/pas2js-for-delphi/blob/master/packages/rtl/system.pas
https://github.com/ying32/duilib-for-Delphi/blob/master/DDuilib/DuiBase.pas
https://github.com/padcom/delcos/blob/master/components/dunit/src/TestFramework.pas
https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.TMethod
https://docwiki.embarcadero.com/CodeExamples/Alexandria/en/Event_RTTI_Invocation_(Delphi)
https://docwiki.embarcadero.com/Libraries/Sydney/en/System.TObject
https://www.thoughtco.com/create-delphi-form-from-a-string-1057672
https://flylib.com/books/en/2.37.1/core_library_classes.html
https://stackoverflow.com/questions/45635147/dynamically-created-object-providing-its-classname-as-a-string-do-not-call-its
https://www.freepascal.org/docs-html/rtl/system/tobject.html
https://blog.xuite.net/peterlee.tw/twblog/211753269
https://slideplayer.com/slide/4497543/
https://slideplayer.com/slide/4290203/
https://docwiki.embarcadero.com/Libraries/Sydney/fr/System.Threading.TThreadPool.TThreadPoolMonitor
https://blog.marcocantu.com/blog/2014-december-spelunking-rtl-since-xe2.html
https://community.embarcadero.com/index.php/blogs/entry/parallel-programming-using-the-new-rad-studio-xe7-runtime-library
https://blog.marcocantu.com/blog/2017-november-explaining-tasks-ppl-too-many.html
http://www.omnithreadlibrary.com/book/chap02.html#introduction
https://docwiki.embarcadero.com/Libraries/Sydney/en/System.SyncObjs.TInterlocked
https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.AtomicIncrement
https://www.cnblogs.com/jijm123/p/14277122.html
https://docwiki.embarcadero.com/Libraries/Sydney/en/System.Diagnostics.TStopwatch
https://github.com/PacktPublishing/Delphi-High-Performance/blob/master/Chapter%206/DHPThreads.pas
System SyncObjs Threading Diagnostics
Cancellable Parallel Tasks With Modal Progress Dialog, i.e., On Delphi’s TTask, PPL, ThreadPool, WaitAll with Progress and the rest
https://zarko-gajic.iz.hr/cancellable-parallel-tasks-with-modal-progress-dialog-i-e-on-delphis-ttask-ppl-threadpool-waitall-with-progress-and-the-rest/
https://docwiki.embarcadero.com/Libraries/Sydney/ja/System.Threading.TThreadPool.TBaseWorkerThread
https://docwiki.embarcadero.com/Libraries/Sydney/en/System.Threading
https://delphiaball.co.uk/tag/parallel-programming/
https://www.3delite.hu/Object%20Pascal%20Developer%20Resources/download.html#tmultithread
https://www.thoughtco.com/multithreaded-delphi-database-queries-1058158
https://www.thoughtco.com/synchronizing-threads-and-gui-delphi-application-1058159
https://torry.net/pages.php?id=244
https://docs.microsoft.com/en-us/archive/msdn-magazine/2010/october/msdn-magazine-thread-pools-scalable-multithreaded-programming-with-thread-pools
Parallel Programming Library (Delphi)
https://www.youtube.com/watch?v=Ni3JDxNFiiw
https://blogs.embarcadero.com/parallel-compiling-300-native-windows-apps-in-45-seconds-with-delphi-on-an-amd-ryzen-9-5950x/
https://github.com/FMXExpress/Delphi-Parallel-Build
Parallel Programming Library: Create Responsive Object Pascal Apps
https://youtu.be/rZfux4by0po
https://github.com/PacktPublishing/Expert-Delphi/tree/master/Chapter03
Parallel Programming Library Create Responsive Object
https://blogs.embarcadero.com/high-performance-vector-matrix-library-for-your-next-scientific-project/
https://github.com/lordcrc/Compute
https://delphi.developpez.com/actu/314586/Utilisation-de-CUDA-sous-Delphi-comment-profiter-de-la-puissance-de-calcul-des-GPU-un-billet-blog-de-Gouyon/
https://stackoverflow.com/questions/5918042/programming-cuda-using-delphi-or-freepascal/9991855#9991855
https://www.youtube.com/watch?v=qxDustSFvys
Presentation on theme: "Presentation 24: RMI, Web services, DCOM Introduction Objektorienteret Middleware."— Presentation transcript:
1 Presentation 24: RMI, Web services, DCOM Introduction Objektorienteret Middleware
2 Part 1: Java RMI
3 Java RMI Java 1.0: object communication confined to objects in one Virtual Machine (VM) Sun Microsystems thus decided to introduce inter VM communication Remote Method Invocation (RMI) from Java 1.1 supports communication between different VMs, potentially across the network Provides tight OO integration with Java Work in heterogeneous environment (servers) BUT ONLY with Java (so far) – so no language transparency (not true when using IIOP)
4 Java RMI features Build on Java’s existing object model -> easy No need for IDL – use Java interfaces Arguments & return values can be all types specializing java.io.Serilizable or java.rmi.Remote Dynamic loading of classes Use of build-in Java Security Manager Distributed Garbage Collection Integrates with CORBA (later) BUT NOT IN J2ME!!! (use Web services) J2ME CDC has an RMI profile!
5 Wire Protocol Java RMI wire protocol: JRMP (Java Remote Method Protocol) OR IIOP (Internet Inter-ORB Protocol) for CORBA connectivity Both build on top of TCP/IP JRMP supports dynamic class loading, IIOP does not Other Java RMI specification implementers Historic: BEA Weblogic, Object Voyager, NinjaRMI Object Voyager’s was JRMP compatible Others were not IIOP compatibility can not be guaranteed
6 Java RMI position Middleware Transaction-Oriented IBM CICS BEA Tuxedo Encina Message-Oriented IBM MQSeries DEC Message Queue NCR TopEnd (SOAP) RPC Systems ANSA Sun ONC OSF/DCE (SOAP) Object-Oriented OMG/CORBA DCOM Java/RMI (SOAP)
7 Local Java call vs. Java RMI callCalledCalled Stub CallerCalledCalledCaller Caller Transport Layer (e.g. TCP or UDP) Similar to SOAP and CORBA – using Proxy
8 package examples.hello; import java.rmi.Naming; import java.rmi.RemoteException; import java.rmi.RMISecurityManager; import java.rmi.server.UnicastRemoteObject; public class HelloImpl extends UnicastRemoteObject implements Hello { public HelloImpl() throws RemoteException { super(); } public String sayHello() { return "Hello World! ; } public static void main(String args[]) { // Create and install a security manager //if (System.getSecurityManager() == null) { // System.setSecurityManager(new RMISecurityManager()); //} try { HelloImpl obj = new HelloImpl(); // Bind this object instance to the name "HelloServer" Naming.rebind("rmi://192.168.1.101/HelloServer", obj); System.out.println("HelloServer bound in registry"); } catch (Exception e) { System.out.println("HelloImpl err: " + e.getMessage()); e.printStackTrace(); } Server object (HelloImpl.java) Security manager needs a security policy – for access control (i.e. file system). Security manager needs a security policy – for access control (i.e. file system). Instantiate a new object and register (bind it) in the ”rmiregistry” Instantiate a new object and register (bind it) in the ”rmiregistry” Implement all methods from interface Hello.java Implement all methods from interface Hello.java Extend UnicastRemote and implemet Hello Interfacet Extend UnicastRemote and implemet Hello Interfacet ”rmiregistry” is a simpel name server with methods to bind objects (bind/rebind) – and Find them again (lookup) –> client ”rmiregistry” is a simpel name server with methods to bind objects (bind/rebind) – and Find them again (lookup) –> client
9 package examples.hello; import java.rmi.Naming; import java.rmi.RemoteException; public class HelloClient { public static void main(String args[]) { try { Hello obj = (Hello)Naming.lookup("rmi://192.168.1.101/HelloServer"); String message = obj.sayHello(); System.out.println(message); } catch (Exception e) { System.out.println("HelloApplet exception: " + e.getMessage()); e.printStackTrace(); } ”lookup” the HelloServer – and call Method sayHello() on Stub ”lookup” the HelloServer – and call Method sayHello() on Stub Client object (HelloClient.java) Remember – that the stub and skeleton classes get generated by the ”rmic” compiler Remember – that the stub and skeleton classes get generated by the ”rmic” compiler AND THAT’S IT!
10 Architecture ServerClient Stub Registry Interfaces Skeleton Activation Interfaces RMI Runtime (rmid,rmiregistry) coded manually rmic generated bind lookup
11 Part 2: Web services: SOAP & WSDL
12 Web Service Defined W3C definition: [Definition: A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.]
13 Overview SOAP & Web services SOAP – Simple Object Access Protocol - & Web services: A light-weight & ultra heterogenic alternative to CORBA, DCOM & RMI Openness in focus – meant for opening legacy applications for others Not meant in the role of Inter business, large scale, transaction heavy communication (as CORBA & J2EE) No services for transactions, concurrency, persistence, scalability Discovery services (UDDI) giving some degree of location transparency Interface Definition Language for heterogeneity (WSDL) Fails on several of the dist. system requirements! But easy to implement yourself!
14 Why Web Services with SOAP When We Have CORBA? CORBA has been considered too complex by many May not be true with new development tools using wizards They aim at solving different tasks: SOAP covers light-weight application integration within the enterprise, exposing legacy business objects across enterprises, and sharing resources (like Google Search Engine, or Sonofon SMS/MMS API) on the net, as well as technology openness CORBA has a wide range of services for (as we have seen): Locating, creating & moving objects Object relationship management between hosts Persistency services – activation frameworks etc. Distributed concurrency and transaction management Security Only some are supported in SOAP tech family – its lightweight Lesson: define your needs – and find the right technology
15 Regarding SOAP SOAP is not by it self revolutionary – its merely: a framework for exchanging XML-based information in a network (via protocols of the TCP/IP family) – with RPC capabilities the currently most hyped XML / Web service technology But when combined with other technologies like WSDL & UDDI It solves several of the requirements of a Distributed System And the fact that it is an open standard – supported by all major software vendors and programming languages: C++ Java C# Delphi Visual Basic and many more Makes it somewhat revolutionary! A practical solution – like WWW
16 Examples of Web Services Google's Web Service - access the Google search engineGoogle's Web Service http://www.google.com/apis/ Amazon's Web Service - access Amazon's product informationAmazon's Web Service http://associates.amazon.com/exec/p anama/associates/join/developer/res ources.html XMethods - collection of information about existing Web servicesXMethods http://www.xmethods.com SalCentral - WSDL / SOAP Web services search-engineSalCentral http://www.salcentral.com/salnet/web serviceswsdl.asp
17 What is SOAP? Simple Object Access Protocol Wire protocol similar to IIOP for CORBA JRMP for RMI XML is used for data encoding “text” based protocol vs. “binary” protocol Supports XML-based RPC W3C XML Protocol working group SOAP 1.2 current version: http://www.w3.org/TR/soap12/http://www.w3.org/TR/soap12/ Microsoft, SUN, Oracle, HP, IBM all support the W3C recommendation but there are still differences to be overcome security issues, transactions etc.
18 SOAP Message Format Possible to Attach binaries (images, cryptographic material) to attachments
19 Request to HelloWorld.jws Input parameters type string HTTP Post Call HTTP Host Target Method name
20 … and the HTTP Response from Server HTTP Response Method Response Parameter value Parameter name Apache Tomcat Server Responding
21 How to make a Web service You need an application or API capable of supporting: Communication over the Internet (HTTP) XML Parsing capabilities Two examples of Application Servers with support: Apache Tomcat Application Server with AXIS Microsoft Internet Information Server JAX-RPC (JSR-101) Java™ API for XML-based RPC Need to implement features manually
22 WSDL the IDL of Web services WSDL is used for describing WebServices XML language for describing web services Web service is described as – A set of communication endpoints (ports) Endpoint is made of Abstract definitions of operations and messages Concrete binding to networking protocol and message format
23 HelloWorld.jws?wsdl
24 Tools Generate WSDL document from existing Java classes or EJB components AXIS: Java2WSDL Generate SOAP messages from WSDL document (via client stub and server skeleton) JAX-RPC, Forte for Java, JBuilder, JDeveloper
25 SOAP and Distributed Objects SOAP in it self has nothing to do with objects There is SOAP API’s for C and COBOL The trick is the supporting API’s converting objects to WSDL and SOAP for serialization across the network Using the Proxy Pattern for decoupling – perhaps with the Façade Pattern for larger granularity
26 Example Java Client (AXIS Framework) package hello; public class HelloWorldClient { public static void main (String args[]) throws Exception { // Make a service HelloWorldService service = new HelloWorldServiceLocator(); //Now use the service to get a stub which implements the SDI HelloWorld stub = (HelloWorld) service.getHelloWorld(); String text = stub.getHelloWorldMessage("Test af OO indpakning"); System.out.println(”Recieved from server: "+text); } Start by generating the Clients stub given the WSDL (-p = destination package = hello): java org.apache.axis.wsdl.WSDL2Java http://localhost:8080/axis/HelloWorld.jws?wsdl –p hello
27 Heterogeneous system C# to Java Proxy DLL stub generated by VS Proxy skeleton class generated by AXIS // Hello World.Java public class HelloWorld { public HelloWorld() { } public String getHelloWorldMessage(String name) { return "Hello World to "+name; } private void button1_Click(object sender, System.EventArgs e) { localhost.HelloWorldService hello = new localhost.HelloWorldService(); textBox1.Text = hello.getHelloWorldMessage("Stefan"); } C# to Java Add Web Reference: We need to generate a new Proxy DLL Other way around works as well Proxy: if we are not using.JWS deployment, we need to generate the skeleton classes in AXIS as well
28 Web Service Support Windows COM, Win32, C++/ATL,.NET (CLS e.g. C#), Java Windows CE eC++/eVB,.NET CF (CLS e.g. C#) UNIX / LINUX C++, Java Mobile Devices: C++ based Frameworks JME CLDC MIDP 2.0 JSR 172 Web PHP, ASP.NET, JSP/Servlets
29 Part 3: COM/DCOM
30 Goals of COM Binary encapsulation Clients do not have to be re-compiled if server objects change Binary compatibility Client and server objects can be developed with different development environments and in different languages Access & Location transparency in-process cross-process cross-machine Zero sacrifice in-proc performance Simplest model possible Enable extensibility and adaptability To provide a component object model that facilitates: Almost exactly what the.NET Frameworks handles Microsoft recommends -> use.NET not COM Is still a major part of Win32 operating systems incl..NET
31 The COM Runtime COM is a proprietary Microsoft standard But other companies have implemented COM on other platforms (e.g. Software AG on Unix) Highly debugged and tuned The COM Runtime first shipped in 1993 Used by 1000s of commercial applications DCOM first released in Windows NT 4.0, August 1996 Win95 version released January 1997 COM/DCOM Available today on Win95, Win98 and WinME NT, Win2K and XP, Windows CE Solaris, HPUX, Linux, MVS, VMS, Mac and others Free! (Built-into Win32 Platforms) No separate client access license or expensive “developer” version Full source code licensable
32 COM History COM is some what tainted by its legacy 16 bit OLE 1.0: for advanced clipboard (replacing DDE) 16 bit OLE 2.0: more advanced -> introducing COM Visual Basic VBX: for extending Visual Basic with e.g. C++ and other components -> later OCX OLE Controls (OCX): container implemented in DLL 32-bit OLE: NT 3.51 (an shortly after Windows 95). An inter- process infrastructure was build on MS-RPC Network-OLE: pre NT 4.0 (name dropped) COM & DCOM: NT 4.0 ActiveX: light weight OLE Controls for e.g. Web pages. Can be written in C++, Delphi, VB COM+: Final step of COM
33 COM is not C++ objects COM is a Component Model Distributed middleware features are only spin-off And as as such is very different from C++ The Binary component makes the difference Implemented as a DLL or an EXE (Service or stand- alone) Like CORBA it uses an IDL language for decoupling (MIDL) A descendent of RPC/IDL with extensions
34 From COM to DCOM “DCOM is just COM with a longer wire” ;-) It’s possible to configure even an in-proc COM-server DLL to be accessed from a remote PC But there are differences: New kind of errors Slower response times Security becomes a very important subject No GUI - server objects can’t access GUI on Client Marshalling necessary – done in proxy-stub-DLL
35 Client Component In the same process Fast, direct function calls Client Component COM Client Process Server Process On the same machine Fast, secure IPC Across machines Secure, reliable and flexible DCE-RPC based DCOM protocolCOM DCE RPC Client Server Machine Client Machine COM Component Accessing COM Services
36 DCOM Access Transparency All COM components communicate in the same way on the same machine In-process or Out-of-process across a Local Area Network across a Wide Area Network across the Internet Same tools, knowledge, code
37 DCOM Wire Protocol Wire Protocol Based on DCE RPC Specification Interoperable with OSF DCE RPC implementations MS call it “ORPC” Efficient and Scalable Documented in Internet-Draft (ftp://ietf.org/internet-drafts/draft-brown-dcom- v1-spec-01.txt)
38 DCOM How to activate a server Like all COM communication, everything starts when the client requests an interface from a server. In DCOM, the client calls CoCreateInstanceEx(), passing in a description of the server computer and requesting a class identifier (CLSID) and Interface This request is handled by the Service Control Manager (SCM), which is a part of Windows. The SCM is responsible for the creation and activation of the COM object on the server computer In the case of DCOM, the SCM will attempt to launch the server on the remote computer (by contacting the SCM on the remote machine)
39 DCOM System Relationships Once the remote COM server has been created, all calls will be marshaled through the proxy and stub objects. The proxy and stub communicate using RPCs (Remote Procedure Calls), which handle all the network interaction. On the server side, the stub object takes care of marshaling. On the client, the proxy does the work. The standard RPC protocol is UDP (User Datagram Protocol). UDP is a connectionless protocol, which seems like a bad fit for a connection-oriented system like DCOM. This isn't a problem however; DCOM automatically takes care of connections.
40 The Server Doesn't Change (much) Any COM server that runs as a program (EXE) will work across a network. In general, you don't have to make any changes to a server to get it to work for DCOM. You may, however, want to add some security to your server, which will involve some effort. If you're using an in-process server (DLL), you will need to make some changes. An in-process server is a DLL, which can't load across a network. A DLL loads into the client program's address space, which will not work for remote connections. There is a work-around called a surrogate, which wraps the DLL in an executable program However, it is usually more appropriate to change the server DLL over to an EXE.
41 COM Support Windows Full COM Support Make COM objects in C++ Use VB, Delphi, PHP, JavaScript, Java to call COM.NET CLS languages has full COM wrapper support Windows CE No DCOM support UNIX / LINUX Some proprietary distributions exist Assumable not easy to implement
42 Læringsmål Alignment Når kurset er færdigt forventes den studerende at kunne: Definere, beskrive og sammenligne forskellige typer af objektorienterede middleware frameworks til apparater og computere, med primær fokus på CORBA og sekundært.NET Remoting teknologierne, herunder fordele og ulemper forbundet med de forskellige teknologier Definere og beskrive principper omkring transparens og heterogenitet i relation til middlewareteknologier Definere og beskrive gængse teorier, metoder og retningslinier indenfor det objektorienterede middleware paradigme og anvende disse til at designe effektive distribuerede systemer Designe og konstruere et distribueret system der gør brug af CORBA og.NET Remoting teknologierne med tilhørende værktøjssupport Med dagens intro Til DCOM, Java RMI, Web Services, WCF, skal I kunne redegøre for forskelle og ligheder, styrker, svagheder, i forhold til CORBA og.NET Remoting. Med dagens intro Til DCOM, Java RMI, Web Services, WCF, skal I kunne redegøre for forskelle og ligheder, styrker, svagheder, i forhold til CORBA og.NET Remoting. Det forventes ikke at I kan redegøre for DCOM, Java RMI, Web services, WCF i detaljer og med kodeeksempler. Kun forstå hvornår de kan bruges fremfor CORBA og.NET Remoting, og hovedprincipperne bag Det forventes ikke at I kan redegøre for DCOM, Java RMI, Web services, WCF i detaljer og med kodeeksempler. Kun forstå hvornår de kan bruges fremfor CORBA og.NET Remoting, og hovedprincipperne bag
Presentation on theme: "K.TOP 2005 Multi-Thread 2005/1/29 Delphi Win32 API 版僕 SouthWind."— Presentation transcript:
1 K.TOP 2005 Multi-Thread 2005/1/29 Delphi Win32 API 版僕 SouthWind
2 Multi-Thread 概述 (1) Time Slice Schedule Code Execute
3 Multi-Thread 概述 (2) Stack Thread Global Heap Stack Thread Stack Thread Process
4 Multi-Thread Communication Stack Thread Global 變數 Stack Thread Stack Thread MessageSignal
5 Multi-Thread 難題 Racing Condition Dead Lock
6 Racing Condition 原因 Global Resource 非 Atomic Execute var4 = (var1 + var2) * var3 mov eax,var1 add eax,var2 mul var3 mov var4,eax
7 避免 Racing Condition Protect Global Resource Synchronization
8 Synchronization Technology : Mutex Critical Section Semaphore Event Interlocked or Atomic API Spin Lock Wait For Object API
9 Dead Lock 原因 設計不良。 不可預期的異常發生。
10 避免 Dead Lock Time Out 機制 清晰的邏輯 Dead Lock detection
11 Delphi & Multi-Thread VCL Synchronize()
12 VCL Non-UI VCL UI VCL 絕大多數的 VCL 元件, 都是 thread none- safe 需要自行設計同步機制保護。
13 Synchronize() 利用 Message 的技巧, 使得 Synchronize() 可以切換至 Main Thread 執行。 快速方便的同步機制
14 Synchronize() Road Map
15 Synchronize() 的誤用 Synchronize() 內執行過長的 Code, 造成 Thread 效益消失或效率不彰。 Synchronize() + Wait For Object 系列 API, 容易產生 Dead Lock 。
16 Multi-Thread 設計小建議 深刻的了解 Multi-Thread 原理與機制。 熟悉善用各種同步機制。 謹慎使用 Synchronize(), 尤其注意有 Wait For Object 系列 API 。 分析同步區執行時間的長短, 以決定最佳的 同步機制。
17 Win32 API (Multi-Thread) CreateThread SuspendThread ResumeThread TerminateThread SetThreadPriority WaitForSingleObject WaitForMultipleObjects
18 Win32 API (Synchronization) InitializeCriticalSection EnterCriticalSection LeaveCriticalSection DeleteCriticalSection CreateMutex ReleaseMutex CloseHandle
19 Win32 API (Synchronization) InterLockedIncrement InterLockedDecrement InterLockedExchange InterLockedExchangeAdd CreateSemaphore ReleaseSemaphore CloseHandle
20 Win32 API For Synchronization Example Download Demo Program From K.TOP : Racing Condition Critical Section Mutex Semphore
21 Delphi & Multi-Thread (1) TThread Class TThread.Suspend Method TThread.Resume Method TThread.Terminate Method Synchronize() [threadvar]
22 Delphi & Multi-Thread (2)
23 Delphi K.TOP 【 Delphi 】【發表】 Multi-Thread 簡報 Demo 範例程式 http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=64439 【 Delphi 】【發表】 Multi-Thread 簡報 Demo 範例程式 Multi-thread / Process 的工作分配 [ 利用 Timer 與 Semaphore] http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=62971 http://delphi.ktop.com.tw/topic.asp?TOPIC_ID=62971 【問題】多執行緒 ( 均帶無窮迴圈 ) 能同時執行嗎 ? http://delphi.ktop.com.tw/TOPIC.ASP?TOPIC_ID=59940 http://delphi.ktop.com.tw/TOPIC.ASP?TOPIC_ID=59940 【 Delphi 】【問題】 WaitForMultipleObjects 的問題.. http://delphi.ktop.com.tw/TOPIC.ASP?TOPIC_ID=50545 【 Delphi 】【問題】 WaitForMultipleObjects 的問題..
24 Reference Win32 API 系統程式實例入門 ( 博碩 ) Inside VCL ( 旗標 ) Programming in Delphi
25 敬請指教 野人獻曝, 若有謬誤, 請各位先進不吝指導。
https://github.com/tothpaul/Delphi/tree/master/DesktopDuplicationAPI
https://www.delphibasics.info/home/delphibasicssnippets/screencapturewithpurewindowsapi
https://stackoverflow.com/questions/27024554/capture-screenshot-from-selected-minimized-window
https://github.com/z505/screenshot-delphi
Capture the Screen Shot of the Active Window
https://stackoverflow.com/questions/661250/how-to-take-a-screenshot-of-the-active-window-in-delphi
https://sourceforge.net/directory/os:windows/?q=delphi+screen+capture
https://stackoverflow.com/questions/35207639/is-possible-to-use-messages-in-a-class-procedure
https://docwiki.embarcadero.com/RADStudio/Sydney/en/Declaring_a_New_Message-handling_Method
procedure WMPaint(var Msg: TWMPaint); message WM_PAINT;
procedure TForm1.WMPaint(var Msg: TWMPaint);
begin
Beep;
inherited;
end;
procedure WndProc(var msg: TMessage);
TApplicationEvent
TApplicationEvents.OnMessage
https://github.com/RRUZ/Delphi-IDE-Colorizer/blob/master/IDE%20PlugIn/Galileo/TApplicationEvents.pas
http://etutorials.org/Programming/mastering+delphi+7/Part+IV+Delphi+the+Internet+and+a+.NET+Preview/Chapter+25+Delphi+for+.NET+Preview+The+Language+and+the+RTL/New+Delphi+Language+Features/
https://www.syncfusion.com/succinctly-free-ebooks/delphi/object-oriented-programming-with-delphi
SetIncludeExclude (Delphi)
Description
Include(EventProp, eventHandler);
Exclude(EventProp, eventHandler);
Multicast Events
Delphi has always had the ability to set an event listener—
https://www.cynet.com.tw/learning/Delphi/Delphi_Basic/049.htm
Const
WM_MYFIRSTMESSAGE=WM_USER+0;
WM_MYSECONDMESSAGE=WM_USER+1;
https://docs.microsoft.com/zh-tw/windows/win32/winmsg/message-and-message-queue-functions
Adventures Delphi Messaging TWinControl message Perform WM_USER
https://docwiki.embarcadero.com/CodeExamples/Sydney/en/SetIncludeExclude_(Delphi)
http://www.delphibasics.co.uk/RTL.asp?Name=include&ExpandCode1=Yes
https://docwiki.embarcadero.com/Libraries/Alexandria/en/System.TFileRec
How to Add Resource Files in Delphi Executables
https://www.thoughtco.com/inside-the-delphi-exe-1058211
Use Delphi Pascal to dynamically add data to an executable file | How to
https://delphidabbler.com/articles/article-7
https://www.delphipraxis.net/144310-save-record-blob.html
https://www.delphipower.xyz/guide_5/loading_data_from_and_saving_data_to_files.html
https://www.thoughtco.com/create-database-delphis-file-typed-files-1058003
https://github.com/KrystianBigaj/kblib
https://stackoverflow.com/questions/3820996/delphi-2010-how-to-save-a-whole-record-to-a-file
http://www.delphicorner.f9.co.uk/articles/apps6.htm
Delphi Corner Article - Working with Files of Records
https://blog.karthisoftek.com/a?ID=01550-94385f1c-6cdf-4f1f-86d0-3b28d8d07222