仓酷云

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1763|回复: 20
打印 上一主题 下一主题

[学习教程] JAVA网页设计Java Thread Programming 1.7 - Concur...

[复制链接]
蒙在股里 该用户已被删除
跳转到指定楼层
楼主
发表于 2015-1-18 11:52:45 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
进而能拉拢大多数程序员用windows产品。并且从ASP.NETAJAX可以跨平台这一点上,间接证明了我们的推断,至少证明了微软做过这方面的研究。所以如果哪一天突然听说了.net可以跨平台了,那么请不要吃惊,如果这一天真的到来,java就到了真正和.net决战的时刻。因为不到万不得以的时候微软是不会推出跨平台的.net的,如果跨平台的.net还不足以对抗java的话,那么微软还剩的手段就是开源了,呵呵。access|objectWhenmultiplethreadsareinteractingwithanobject,controlsneedtobeinplacetoensurethatthethreadsdon’tadverselyaffectoneanother.Thischapterdealswithissuesthatcanintroducesubtleerrorsinyourapplication.Anapplicationthatfailstosafelycontrolconcurrentaccesscanworkproperlymostofthetime―maybenearlyallthetime―butwilloccasionallyproduceerroneousresults.Thismakestheunderstandinganddisciplineduseoftheinformationinthischaptercriticaltowritingtrulythread-safeapplicationsthatworkproperlyallthetime.

假如你的体系呈现了稀里糊涂的成绩,很有多是并发会见的成绩哦

volatileMemberVariableModifier

TheJavaLanguageSpecificationindicatesthatforoptimalspeed,individualthreadsarepermittedtokeepaworkingcopyofsharedmembervariablesandonlyreconcilethemwiththesharedoriginaloccasionally.Tobemoreaccurate,theword“occasionally”inthelastsentenceshouldbereplacedwith“whenathreadentersorleavesasynchronizedblockofcode.”I’lltellyoumoreaboutsynchronizedblockslaterinthischapter.Whenonlyonethreadisinteractingwiththemembervariablesofanobject,thisoptimizationworksverywellandcanallowforfasterexecution.Whentwo(ormore)threadsaresimultaneouslyworkingwithanobject,caremustbetakentoensurethatchangesmadetoasharedmembervariablebyonethreadareseenbytheother.

Java标准中申明,为了优化速率,每一个线程都具有共享成员变量的一个拷贝,当线程入手下手或停止一个同步代码块时,才回写变量值。当单线程时,这类机制很好的事情,能够取得更高的功能,可是多个线程协同事情时,必需思索,被一个线程改动的大众变量要被其他线程晓得。

Thevolatilekeywordisusedasamodifieronmembervariablestoforceindividualthreadstorereadthevariable’svaluefromsharedmemoryeverytimethevariableisaccessed.Inaddition,individualthreadsareforcedtowritechangesbacktosharedmemoryassoonastheyoccur.Thisway,twodifferentthreadsalwaysseethesamevalueforamembervariableatanyparticulartime.ChancesarethatmostofyouexpectedthisbehaviorfromtheJavaVMalready.Infact,manyexperiencedJavadevelopersdon’tunderstandwhentheuseofvolatileisnecessary.

Volatile关头字,假如用来润色成员变量,则强制每一个线程每次会见这个变量都要从头读取,每次改动变量值时都要尽快回写。如许,两个分歧的线程在特准时间总能取得不异的变量值

Usevolatileonmembervariablesthatcanbeaccessedbytwoormorethreadsunlessallthethreadsaccessthevariableswithinsynchronizedblocksofcode.Ifamembervariableremainsconstantafterconstruction(itisread-only),thereisnoneedforittobevolatile.

假如一个成员变量是只读的,则没有需要设置为volatile
假如一个一切的线程会见这个变量都是在一个同步代码块中,则没有需要设置为volatile

ThevolatilemodifierexiststorequestthattheVMalwaysaccessthesharedcopyofthevariable.ThisislessefficientthanallowingtheVMtoperformoptimizationsbykeepingaprivatecopy.Youshouldusevolatileonlywhenitisnecessary;overusewillunnecessarilyslowtheapplication’sexecution.

Volatile请求假造机的每次对变量的哀求都要回访,这关于每一个线程坚持一个公有拷贝是低效的,会下降会见速率,如非需要,不要利用

synchronizedMethodModifier

Theadditionofthesynchronizedmodifiertoamethoddeclarationensuresthatonlyonethreadisallowedinsidethemethodatatime.Thiscanbeusefulinkeepingoutotherthreadswhilethestateofanobjectistemporarilyinconsistent.

Synchronized润色,用来润色一个办法声名,能够包管统一工夫只要一个线程可以挪用此办法。
这类机制可以避免对象处于不一连形态时被其他线程会见

TwoThreadsSimultaneouslyintheSameMethodofOneObject
Iftwoormorethreadsaresimultaneouslyinsideamethod,eachthreadhasitsowncopyoflocalvariables.

两个或多个线程同时挪用统一对象的不异办法,则每个线程具有部分变量的拷贝

OneThreadataTime
Morethanonethreadcanbeinsideamethod,andeachthreadkeepsacopyofitsownlocalvariables.However,therearetimeswhenapplicationconstraintsrequirethatonlyonethreadbepermittedinsideamethodatatime.

Whenathreadencountersasynchronizedinstancemethod,itblocksuntilitcangetexclusiveaccesstotheobject-levelmutexlock.Mutexisshortformutualexclusion.Amutexlockcanbeheldbyonlyonethreadatatime.Otherthreadswaitingforthelockwillblockuntilitisreleased.Whenthelockisreleased,allthethreadswaitingforitcompeteforexclusiveaccess.Onlyonewillbesuccessful,andtheotherthreadswillgobackintoablockedstatewaitingforthelocktobereleasedagain.

包管统一工夫只要一个线程挪用某个办法,只需在办法声名前加上synchronized。当一个线程碰着声名为sychronized的办法实例时,会堵塞,直到它取得对象级互斥锁旌旗灯号量的会见权,互斥旌旗灯号在某个时候只能被一个线程具有,其他守候此旌旗灯号的线程必需期待此旌旗灯号被开释,此互斥锁开释后,其他线程合作会见权,乐成的线程运转,其他的线程持续堵塞守候此互斥锁的再次开释。

TwoThreads,TwoObjects
Everyinstanceofaclasshasitsownobject-levellock.

AlthoughthedoStuff()methodissynchronized,thereisnocompetitionforexclusiveaccesstotheobject-levellock.Eachinstance,obj1andobj2,hasitsownobject-levellock.WhenthreadAentersthedoStuff()methodofobj1(line1),itacquiresexclusiveaccesstotheobject-levellockforobj1.WhenthreadBentersthedoStuff()methodofobj2(line3),itacquiresexclusiveaccesstotheobject-levellockforobj2.

每一个对象的实例有本人的对象级锁。换言之,synchronized锁是创建在对象的实例上的,而不是笼统的对象上的。多个线程挪用统一个对象实例的统一个synchronized办法时,会同步会见,而多个线程挪用统一对象分歧实例的统一个synchronized办法时,是不相互互斥会见的。

AvoidingAccidentalCorruptionofanObject
It’sanunavoidablefactthattheobjectmustbeinaninconsistentstateforabriefperiodoftime,evenwitheverythingexcepttheassignmentstakenout:

publicsynchronizedvoidsetNames(StringfirstName,StringlastName){
fname=firstName;
lname=lastName;
}

Nomatterhowfasttheprocessoris,it’spossiblethatthethreadschedulercouldswapoutthethreadmakingthechangesafterithaschangedfnamebutbeforeithaschangedlname.Holdinganobject-levellockdoesnotpreventathreadfrombeingswappedout.Andifitisswappedout,itcontinuestoholdtheobject-levellock.Becauseofthis,caremustbetakentoensurethatallreadsareblockedwhenthedataisinaninconsistentstate.CleanRead(seeListing7.16)simplyaddsthesynchronizedmethodmodifiertogetNames()tocontrolconcurrentreadingandwriting.

两个线程同时挪用某实例的办法修正某些变量值,会招致这些变量值在某个时候形态不一连,加上synchronized润色此办法,可包管此变量值的完全性

DeferringAccesstoanObjectWhileItIsInconsistent
一个线程在挪用某个synchornized设置值的办法修正某个实例的某些变量值的时分,只是限定其他线程同时挪用此办法,其实不限定其他线程挪用其余办法会见这些变量值,假如此时另外一个线程在挪用某个取得值的办法会见这些变量,某些变量大概已被修正,而别的一些变量还没有修正,有大概形成变量的不一连。
将取得值得办法前加上synchronized润色符,可办理此成绩。由于,一个对象实例只要一个对象级锁,当一个synchronized办法被挪用时,此实例的其他synchronized办法必需守候此锁开释。

Iftwoormorethreadsmightbesimultaneouslyinteractingwiththemembervariablesofanobject,andatleastoneofthosethreadsmightchangethevalues,itisgenerallyagoodideatousesynchronizedtocontrolconcurrentaccess.Ifonlyonethreadwillbeaccessinganobject,usingsynchronizedisunnecessaryandslowsexecution.

synchronizedStatementBlock
Thesynchronizedblockcanbeusedwhenawholemethoddoesnotneedtobesynchronizedorwhenyouwantthethreadtogetanobject-levellockonadifferentobject.

Synchronizedblock合用局限
1、不是全部办法都必要同步
2、必要锁定分歧的对象

Thesynchronizedstatementblocklookslikethis:
synchronized(obj){
//blockofcode
}

whereobjisareferencetotheobjectwhoseobject-levellockmustbeacquiredbeforeenteringtheblockofcode.
ThissetPoint()method
publicsynchronizedvoidsetPoint(intx,inty){
this.x=x;
this.y=y;
}
canberewrittentoinsteaduseasynchronizedblock:
publicvoidsetPoint(intx,inty){
synchronized(this){
this.x=x;
this.y=y;
}
}

ThebehaviorofbothversionsofsetPoint()isvirtuallythesame.Theydocompiletodifferentbyte-code,butbothofthemmakesurethattheyhaveexclusiveaccesstotheobject-levellockfortheinstancebeforemakingchangestoxandy.

ReducingtheTimeThattheLockIsHeld
Asynchronizedblockcanbeusedtoreducethetimethattheobject-levellockisheld.Ifamethoddoesalotofotherthingsthatdon’trequireaccesstothemembervariables,itcanshortenthetimethatitholdsthelocktojustthecriticalportion:
publicvoidsetValues(intx,doubleratio){
//Someother,long-runningstatementsthatdon’twork
//withthemembervariablesgohere.
//...
doubleprocessedValA=//...longcalculation...
doubleprocessedValB=//...longcalculation...
//...
synchronized(this){
a=processedValA;
b=processedValB;
}
InsetValues(),exclusiveaccesstotheobject-levellockisnotneededuntilthetime-consumingcalculationshavebeenmadeandtheresultsarereadytobestored.Atthebottomofthemethod,theobject-levellockisacquiredandheldbrieflytosimplyassignnewvaluestothemembervariablesaandb.

削减锁准时间,这类体例只对必要同步的中央加锁,最小化锁定开支

LockinganObjectOtherThanthis
锁定一个非this的对象

thereferencemutexindicatestheobjectwhoseobject-levellockmustbeacquiredbeforeenteringthestatementblock.ItcanbeareferencetoanyobjectintheVM,notjustthis.Regardlessofhowathreadleavesasynchronizedblock,itautomaticallyreleasesthelock.Thisincludesareturnstatement,athrowstatement,orjustfallingthroughtothenextstatementaftertheblock.Callingamethodfromwithinthesynchronizedblockdoesnotconstituteleavingtheblock(thelockisstillheld).

能够同步假造机内的任何对象,而不单单是this。

Sometimesyouwillneedtocalltwosynchronizedmethodsonanobjectandbesurethatnootherthreadsneaksinbetweenthecalls.ConsiderthiscodefragmentfromaclasscalledBucket:

偶然候两个synchronized办法必需同时实行

publicclassBucketextendsObject{
//...
publicsynchronizedbooleanisSpaceAvailable(){//...
publicsynchronizedvoidadd(BucketItemo)
throwsNoSpaceAvailableException{//...
publicsynchronizedBucketItemremove(){//...
//...
}

一种挪用办法:
Bucketb=//...
//...
if(b.isSpaceAvailable()){
b.add(item);
}

ThisisfineifonlyonethreadisinteractingwiththisinstanceofBucket.ButifmultiplethreadsarepotentiallytryingtoaddBucketItemobjectstothesameBucket,anewapproachhastobetakentoavoidaracecondition.ImaginethatthreadAchecksandseesthatspaceisavailable,butbeforeitactuallyaddsitsitem,threadBchecksandalsoseesthatspaceisavailable.NowthreadAandthreadBareracingtoactuallyaddanitem.Onlyonecanwintherace,andthatthreadgetstoadditsitem.TheotherthreadwillfailtoadditsitemandwillthrowaNoSpaceAvailableException.Topreventthisproblem,asynchronizedblockshouldbewrappedaroundthetwomethodcalls:

这类办法只要一个线程时是准确的,不然会产生同步毛病

Bucketb=//...
//...
Synchronized(b){
if(b.isSpaceAvailable()){
b.add(item);
}
}

Thesynchronizedblockusestheobject-levellockonb,theBucketinstance.ThisisthesamelockthatmustbeacquiredbeforeenteringtheisSpaceAvailable()andadd()methods.Ifathreadcangettheobject-levellockandenterthesynchronizedblock,itisguaranteedtobeabletoinvokeisSpaceAvailable()andadd()withoutblocking.Becauseitalreadyhastheobject-levellockforb,thereisnodelayorcompetitiontoenterthesynchronizedmethods.Inaddition,nootherthreadcaninvokethesemethodsuntilthefirstthreadleavesthesynchronizedblock.

把这段代码放在一个b锁中,则其他线程不克不及挪用b中的任何synchronized办法,一旦一个某个线程取得b锁,则一定能够实行锁中的代码,没有其他线程的合作

staticsynchronizedMethods

Inadditiontotheobject-levellockthatexistsforeachinstanceofaclass,thereisaclass-levellockthatallinstancesofaparticularclassshare.EveryclassloadedbytheVMhasexactlyoneclass-levellock.Ifamethodisbothstaticandsynchronized,athreadmustgetexclusiveaccesstotheclass-levellockbeforeenteringthemethod.

Theclass-levellockcanbeusedtocontrolconcurrentaccesstostaticmembervariables.Justastheobject-levellockwasneededtopreventdatacorruptioninnon-staticmembervariables,theclass-levellockisneededtopreventcorruptionofstaticmembervariables.Evenwhennovariablesareinvolved,thesynchronizedmodifiercanbeusedonstaticmethodssimplytoensurethatonlyonethreadisinsidethemethodatatime.

object-levellock对应于类的每一个实例
class-levellock对应于类一切实例,假造机天生的每个类都有一个class-levellock,关于一个staticsynchronizedmethod,在挪用此办法前,线程会排他会见class-levellock。

UsingtheClass-LevelLockinasynchronizedStatement

Thesynchronizedstatementcanalsouseaclass-levellock.Thiscanbeusefulifastaticmethodrunsforalongperiodoftime.Additionally,itcanbeusedtoensurethattwostaticmethodcallsbyonethreadarenotinterleavedwithacallbyanotherthread.

Tolockontheclass-levellock,usethefollowingcode
synchronized(ClassName.class){
//body
}

利用Class-LevelLock来同步代码块,利用synchronized(类名.class){}

SynchronizationandtheCollectionsAPI

VectorandHashtablewereoriginallydesignedtobemultithread-safe.TakeVector,forexample―themethodsusedtoaddandremoveelementsaresynchronized.IfonlyonethreadwilleverinteractwithaninstanceofVector,theworkrequiredtoacquireandreleasetheobject-levellockiswasted.

Vector和Hashtable最后计划成线程平安,他们中的年夜部分办法都是synchronized,这在单线程程序中是不用要的

ThedesignersoftheCollectionsAPIwantedtoavoidtheoverheadofsynchronizationwhenitwasn’tnecessary.Asaresult,noneofthemethodsthatalterthecontentsofacollectionaresynchronized.IfaCollectionorMapwillbeaccessedbymultiplethreads,itshouldbewrappedbyaclassthatsynchronizesallthemethods.

Collectionsarenotinherentlymultithread-safe.Extrastepsmustbetakenwhenmorethanonethreadwillbeinteractingwithacollectiontomakeitmultithread-safe.

CollectionAPI计划为当必要的时分为synchronized,默许不是线程平安的,假如在多线程情况中利用Collection,起首要把其转换为线程平安

ThereareseveralstaticmethodsintheCollectionsclassthatareusedtowrapunsynchronizedcollectionswithsynchronizedmethods:
publicstaticCollectionsynchronizedCollection(Collectionc)
publicstaticListsynchronizedList(Listl)
publicstaticMapsynchronizedMap(Mapm)
publicstaticSetsynchronizedSet(Sets)
publicstaticSortedMapsynchronizedSortedMap(SortedMapsm)
publicstaticSortedSetsynchronizedSortedSet(SortedSetss)

汇合类中供应了几种静态办法用来将非线程平安汇合转换为线程平安汇合,如上,用法以下:

Basically,thesemethodsreturnnewclassesthathavesynchronizedversionsofthecollections’methods.TocreateaListthatismultithread-safeandbackedbyanArrayList,usethefollowing:
Listlist=Collections.synchronizedList(newArrayList());

Whensynchronizingcollections,donotkeepanydirectreferencetotheoriginalunsynchronizedcollection.Thiswillensurethatnootherthreadaccidentallymakesuncoordinatedchanges.

为了包管汇合同步,不要间接利用最后非线程平安的汇合。

SafelyCopyingtheContentsofaListintoanArray
三种办法平安拷贝List为数组

SafelyIteratingThroughtheElementsofaCollection
平安遍历汇合,遍历的时分避免其他线程增加或修正汇合中数据
TheelementsofaCollectioncanbesteppedthroughonebyonebyusinganIterator.Inamultithreadedenvironment,youwillgenerallywanttoblockotherthreadsfromaddingorremovingelementswhileyouareiteratingthroughthecurrentcollectionofelements.

Deadlocks

Usinglockstocontrolconcurrentaccesstodataiscriticaltoavoidsubtleraceconditionswithinapplications.However,troublecanarisewhenathreadneedstoholdmorethanonelockatatime.

利用锁机制把持关头数据的并发会见,当一个线程同时具有两个以上锁时大概会呈现成绩:逝世锁

Deadlockscanbeextremelydifficulttotrackdown.Generally,mostofanapplicationwillcontinuetorun,butacoupleofthreadswillbestuckinadeadlock.Tomakemattersworse,deadlockscanhideincodeforquiteawhile,waitingforarareconditiontooccur.Anapplicationcanrunfine99outof100timesandonlydeadlockwhenthethreadschedulerhappenstorunthethreadsinaslightlydifferentorder.Deadlockavoidanceisadifficulttask.

Mostcodeisnotvulnerabletodeadlocks,butforthecodethatis,tryfollowingtheseguidelinestohelpavoiddeadlocks:
lHoldlocksforonlytheminimalamountoftimenecessary.Considerusingsynchronizedstatementblocksinsteadofsynchronizingthewholemethod.
lTrytowritecodethatdoesnotneedtoholdmorethanonelockatatime.Ifthisisunavoidable,trytomakesurethatthreadsholdthesecondlockonlyforabriefperiodoftime.
lCreateanduseonebiglockinsteadofseveralsmallones.Usethislockformutualexclusioninsteadoftheobject-levellocksoftheindividualobjects.
lCheckouttheInterruptibleSyncBlockclassinChapter17.Itusesanotherobjecttocontrolconcurrentaccesstoasectionofcode.Additionally,insteadofhavingathreadblockonthesynchronizedstatement,thethreadisputintoawait-statethatisinterruptible.I’lltellyoumoreaboutthewait-notifymechanisminChapter8.

逝世锁很难制止,一样平常有以下准绳可下降逝世锁呈现的大概性
l锁定只管短的工夫,只管利用synchronizedstatement而不是利用synchronized全部办法
l只管分歧时具有凌驾一个锁,假如不成制止,要包管线程持有第二个锁只管短的工夫
l创建利用一个年夜锁,而不是多个小锁,用一个新的年夜锁代笔各个对象上的小锁
l17章给出InterruptibleSyncBlock类,它利用另外一个对象来把持代码块的并发会见。不要让一个线程在同步一个statement时堵塞,而是置于可中止的wait形态,利用下一章将会商的wait-notify机制。

SpeedingConcurrentAccess

Tospeedupexecution,donotusesynchronizedunnecessarily.Besurethatit’sreallyneededforproperfunctioning.Ifsynchronizationisnecessary,seeifusingasynchronizedstatementblockwouldworkinsteadofasynchronizedmethod.Althoughthiswon’tdecreasethecostofacquiringandreleasingthelock,itwillreducecontentionforthelockamongtheotherthreadsbecausethelockisheldforashorterperiodoftime.

加速同步会见速率的办法:
1、如非需要,不合用synchronized
2、能利用synchronizedstatementblock就不利用synchronizedmethod,会下降抵触的几率

Summary

Inthischapter,Ishowedyou:

lHowtousevolatiletoforceunsynchronizedthreadstoworkwiththesharedcopyofavariableinsteadofaprivateworkingcopy.
lHowtousethesynchronizedmethodmodifieronnon-staticmethodstorequireathreadtogetexclusiveaccesstotheobject-levellockbeforeenteringthemethod.
lHowtousethesynchronizedstatementblocktorequireathreadtogetexclusiveaccesstotheobject-levellockofthespecifiedobjectbeforeexecutingthecodewithintheblock.
lHowtousethesynchronizedmethodmodifieronstaticmethodstorequireathreadtogetexclusiveaccesstotheclass-levellockbeforeenteringthemethod.
lHowtoworksafelywiththeCollectionsAPIinamultithreadedenvironment.
lHowtounderstandthecausesofdeadlocks,andhowtotrytoavoidthem.

利用volatile润色符包管多线程变量的同步
利用synchronized润色符包管一个对象实例在object-levellock上同步
利用synchronized润色符包管对象staticmethod在class-levellock上同步
为包管线程平安利用汇合类,起首要对汇合类举行转换天生线程平安的汇合类

前些天,在CSDN上看到了一个消息,说是ASP.NETAJAX成功在Linux上运行,这一点对我触动很大,而且引发了我许多感叹,所以想写出来分享一下。
谁可相欹 该用户已被删除
沙发
发表于 2015-1-21 16:40:31 | 只看该作者
是一种突破用户端机器环境和CPU
若相依 该用户已被删除
板凳
发表于 2015-1-30 21:13:46 | 只看该作者
是一种使网页(Web Page)产生生动活泼画面的语言
柔情似水 该用户已被删除
地板
发表于 2015-2-6 16:00:12 | 只看该作者
你现在最缺的是实际的工作经验,而不是书本上那些凭空想出来的程序。
飘灵儿 该用户已被删除
5#
发表于 2015-2-7 08:21:26 | 只看该作者
让你能够真正掌握接口或抽象类的应用,从而在原来的Java语言基础上跃进一步,更重要的是,设计模式反复向你强调一个宗旨:要让你的程序尽可能的可重用。
活着的死人 该用户已被删除
6#
发表于 2015-2-14 09:59:34 | 只看该作者
是一种由美国SUN计算机公司(Sun Microsystems, Inc.)所研究而成的语言
若天明 该用户已被删除
7#
发表于 2015-2-20 14:37:15 | 只看该作者
那么我书也看了,程序也做了,别人问我的问题我都能解决了,是不是就成为高手了呢?当然没那么简单,这只是万里长征走完了第一步。不信?那你出去接一个项目,你知道怎么下手吗,你知道怎么设计吗,你知道怎么组织人员进行开发吗?你现在脑子里除了一些散乱的代码之外,可能再没有别的东西了吧!
小魔女 该用户已被删除
8#
发表于 2015-2-26 03:13:14 | 只看该作者
J2SE开发桌面应用软件比起 VC,VB,DEPHI这些传统开发语言来说,优势好象并不明显。J2ME对于初学者来说,好象又有点深奥,而且一般开发者很难有开发环境。
第二个灵魂 该用户已被删除
9#
发表于 2015-3-6 21:17:16 | 只看该作者
[url]http://www.jdon.com/[/url]去下载,或到同济技术论坛的服务器[url]ftp://nro.shtdu.edu.cn[/url]去下,安装上有什么问题,可以到论坛上去提问。
爱飞 该用户已被删除
10#
发表于 2015-3-8 11:39:11 | 只看该作者
Sun公司看见Oak在互联网上应用的前景,于是改造了Oak,于1995年5月以Java的名称正式发布。Java伴随着互联网的迅猛发展而发展,逐渐成为重要的网络编程语言。
再见西城 该用户已被删除
11#
发表于 2015-3-15 22:18:56 | 只看该作者
你一定会高兴地说,哈哈,原来成为Java高手就这么简单啊!记得Tomjava也曾碰到过一个项目经理,号称Java很简单,只要三个月就可以学会。
老尸 该用户已被删除
12#
发表于 2015-3-17 00:10:15 | 只看该作者
接着就是EJB了,EJB就是Enterprise JavaBean, 看名字好象它是Javabean,可是它和Javabean还是有区别的。它是一个体系结构,你可以搭建更安全、更稳定的企业应用。它的大量代码已由中间件(也就是我们常听到的 Weblogic,Websphere这些J2EE服务器)完成了,所以我们要做的程序代码量很少,大部分工作都在设计和配置中间件上。
分手快乐 该用户已被删除
13#
发表于 2015-3-17 01:22:47 | 只看该作者
是一种将安全性(Security)列为第一优先考虑的语言
精灵巫婆 该用户已被删除
14#
发表于 2015-3-23 12:03:58 | 只看该作者
你可以去承接一些项目做了,一开始可能有些困难,可是你有技术积累,又考虑周全,接下项目来可以迅速作完,相信大家以后都会来找你的,所以Money就哗啦啦的。。。。。。
蒙在股里 该用户已被删除
15#
 楼主| 发表于 2015-4-1 06:09:37 | 只看该作者
[url]http://www.jdon.com/[/url]去下载,或到同济技术论坛的服务器[url]ftp://nro.shtdu.edu.cn[/url]去下,安装上有什么问题,可以到论坛上去提问。
只想知道 该用户已被删除
16#
发表于 2015-4-5 11:09:54 | 只看该作者
让你能够真正掌握接口或抽象类的应用,从而在原来的Java语言基础上跃进一步,更重要的是,设计模式反复向你强调一个宗旨:要让你的程序尽可能的可重用。
不帅 该用户已被删除
17#
发表于 2015-4-10 11:36:28 | 只看该作者
吧,现在很流行的Structs就是它的一种实现方式,不过Structs用起来实在是很繁,我们只要学习其精髓即可,我们完全可以设计自己的MVC结构。然后你再研究一下软件Refactoring (重构)和极限XP编程,相信你又会上一个台阶。 做完这些,你不如整理一下你的Java代码,把那些经典的程序和常见的应用整理出来,再精心打造一番,提高其重用性和可扩展性。你再找几个志同道合的朋友成立一个工作室吧
小妖女 该用户已被删除
18#
发表于 2015-4-12 05:19:14 | 只看该作者
任职于太阳微系统的詹姆斯·高斯林等人于1990年代初开发Java语言的雏形,最初被命名为Oak,目标设置在家用电器等小型系统的程序语言
山那边是海 该用户已被删除
19#
发表于 2015-4-13 18:19:31 | 只看该作者
有时间再研究一下MVC结构(把Model-View-Control分离开的设计思想)
莫相离 该用户已被删除
20#
发表于 2015-5-4 03:44:44 | 只看该作者
应用在电视机、电话、闹钟、烤面包机等家用电器的控制和通信。由于这些智能化家电的市场需求没有预期的高,Sun公司放弃了该项计划。随着1990年代互联网的发展
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|仓酷云 鄂ICP备14007578号-2

GMT+8, 2024-5-12 23:32

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表