Java-I just switched from JAVA to PHP and encountered the problem of referencing classes in other files.

Source: Internet
Author: User
JAVAC # References are all in the first few lines of the file. when this guy asks me to write PHP, the reference should be dynamically referenced and written in a certain type of method. I'm wondering, performance, convenience... daniel's usage is as follows (thinkPHP framework is used. we will not discuss the framework quality, but PHP only): & quot; ClassTest {functiononePerson () {import & quot; lib. person & quot; $ pnewPerson (); $ p-& gt; talk () ;}functionkillperson () {import & quot; lib. per java reference php performance

JAVA/C # References are all in the first few lines of the file. when this guy asks me to write PHP, the reference should be dynamically referenced and written in a certain type of method.
I'm wondering, performance, convenience...
The usage of Daniel is as follows (thinkPHP framework is used. we will not discuss the framework quality, but PHP only ):

Class Test {function onePerson () {import "lib. person "; $ p = new Person (); $ p-> talk ();} function killPerson () {import" lib. person "; $ p = new Person (); $ p-> kill ($ t);} funtion conmunication (){....}}

He said that dynamic reference can save resources by referencing this file only when this method is used, so the server pressure will be reduced.
However, I think it is very troublesome to write such a statement. it is often necessary to write three sentences in the result of a sentence.

C # and JAVA are not written in this way. code redundancy is annoying. Will the image performance be high? Or do you have to worry about it?
The company cares about performance issues. Why does JAVA and C # not need to be written like this?

Please help me analyze and analyze, or help me instill some theoretical knowledge.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.