DOC PREVIEW
Columbia COMS 3156 - Software Engineering Recitation

This preview shows page 1-2-3-24-25-26 out of 26 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Software EngineeringReviewTodayThreads/pThreadsBit OperatorsBit operators in JavaBitwise operatorsEg-The GNU make utilityExample of a MakefileFrom the exampleJavadocsExampleRMI/SienaMore on RMIMore RMI…RMI contd…RMI/Remote InterfaceRMI/serverRMI/server-deployRMI/policy.allRMI/server startRMI/clientSlide 24RMI/run the clientConclusionSoftware EngineeringRecitation 7Suhit GuptaReviewAnything from last time???TodayThreads/pthreadsBit operators in JavaThe GNU make utilityJavadocsRMI/SienaThreads/pThreadsWe have already done threads (therefore we are going to skip)pThreads used in C. (POSIX Threads)pThreads is the name of a machine-independent library of functions that are generally used to facilitate the multiprocessing of programs on shared memory machines. pThreads is used to synchronize threads.Bit OperatorsBit operators treat Number types as a 32 bit value, change bits according to the operator and then converts the value back to Number when done. The operators are bitwise NOT (~), AND (&), OR (|), XOR (^), left shift (<<), right shift (>>), unsigned right shift (>>>).Bit operators in JavaBitwise operations are not to be confused with logical operations (&&, ||...)& - and| - or<< - shift left>> - shift right^ - XOR~ - compliment/notBitwise operatorsBitwise operators (AND, OR) can be used in place of logical operators (&&,||), but they are less efficient, because logical operators are designed to reduce the number of comparisons made, in an expression, to the optimum: as soon as the truth or falsity of an expression is known, a logical comparison operator quits. A bitwise operator would continue operating to the last before the final result were known.Bitwise operators are basically arithmetic operation.Now, bitwise are not really inefficient because they are truly put on the chip…The first point is more or less in C. In Java they are fairly different operations.Eg-128 64 32 16 8 4 2 1 ----------------------------------- | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | = 1 ----------------------------------- Shift operators move whole bit patterns left or right by shunting them between boxes. The syntax of this operation is: 1 << 1 would have the value 2, because the bit pattern would have been moved one place the the left: 128 64 32 16 8 4 2 1 ----------------------------------- | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | = 2----------------------------------- Similarly: 1 << 4 has the value 16 because the original bit pattern is moved by four places: 128 64 32 16 8 4 2 1 ----------------------------------- | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | = 16----------------------------------- And: 6 << 2 == 12128 64 32 16 8 4 2 1 ----------------------------------- | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | = 6----------------------------------- Shift left 2 places:128 64 32 16 8 4 2 1 ----------------------------------- | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | = 12-----------------------------------The GNU make utilityhttp://www.gnu.org/manual/make-3.79.1/html_node/make_toc.htmlThe make utility automatically determines which pieces of a large program need to be recompiled, and issues commands to recompile them.You have to have a MakefileRun make to start rules in the Makefile file.Example of a Makefileedit : main.o kbd.o command.o display.o \ insert.o search.o files.o utils.o cc -o edit main.o kbd.o command.o display.o \ insert.o search.o files.o utils.omain.o : main.c defs.h cc -c main.ckbd.o : kbd.c defs.h command.h cc -c kbd.ccommand.o : command.c defs.h command.h cc -c command.cdisplay.o : display.c defs.h buffer.h cc -c display.cinsert.o : insert.c defs.h buffer.h cc -c insert.csearch.o : search.c defs.h buffer.h cc -c search.cfiles.o : files.c defs.h buffer.h command.h cc -c files.cutils.o : utils.c defs.h cc -c utils.cclean : rm edit main.o kbd.o command.o display.o \ insert.o search.o files.o utils.oFrom the exampleTo use this makefile to create the executable file called ‘edit’, type: make make cleanJavadocshttp://java.sun.comJavadoc provides a way to integrate code comments with program documentation.–Enter comments with a series of flags to indicate the type of comment/documentation–Run javadoc to parse the flags and the comments to create an html file documentation of the codeExampleIf you miss recitation then you will miss the demonstrationYou can run –javadoc somefile.javaRMI/SienaWe have done Siena (therefore we will skip)Remote Method Invocation (RMI) enables the programmer to create distributed JavaTM technology-based to Java technology-based applications, in which the methods of remote Java objects can be invoked from other Java virtual machines, possibly on different hosts.More on RMIRemote Method Invocation (RMI) is the object equivalent of Remote Procedure Calls (RPC).While RPC allows you to call procedures over a network, RMI invokes an object's methods over a network.In the RMI model, the server defines objects that the client can use remotely. The clients can now invoke methods of this remote object as if it were a local object running in the same virtual machine as the client.More RMI…RMI hides the underlying mechanism of transporting method arguments and return values across the network.In Java-RMI, an argument or return value can be of any primitive Java type or any other Serializable Java object.Java-RMI is a Java-specific middleware spec that allows client Java programs to invoke server Java objects as if they were local.Java-RMI is tightly coupled with the Java language. Hence there are no separate IDL mappings that are required to invoke remote object methods. This is different from DCOM or CORBA where IDL mappings have to be created to invoke remote methods.IDL==Interface Definition LanguageRMI contd…Because of this, parameters passed during method calls between machines can be true Java Objects. This is impossible in DCOM or CORBA at present.If a process in an RMI system receives an object of a class that it has never seen before, it can request that its class information be sent over the network.Over and above all this, Java-RMI supports Distributed Garbage Collection that ties into the local Garbage Collectors in each JVM.Since both the client and the server may reside on different machines/processes, there needs


View Full Document

Columbia COMS 3156 - Software Engineering Recitation

Download Software Engineering Recitation
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Software Engineering Recitation and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Software Engineering Recitation 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?