Topic: 能否在java类运行时,给该类加一函数或属性?

  Print this page

1.能否在java类运行时,给该类加一函数或属性? Copy to clipboard
Posted by: feiggle
Posted on: 2005-07-05 14:16

能否在java类运行时,给该类增加若干函数和属性,就是动态构造类,并且在静态时,可以引用该类的这些函数和属性?

2.Re:能否在java类运行时,给该类加一函数或属性? [Re: feiggle] Copy to clipboard
Posted by: ranchgirl
Posted on: 2005-07-06 03:20

Wow, what a great attractive option you suggested?

I did a search, and found out someone has really implemented what you suggested! Imagination has no limit!

Thanks!

See this article:

Open Classes
Open classes are classes to which you can freely add new methods. Normally, if you want to add a method to a class, you have to modify the source code for that class. With open classes, you don't. Adding a method to a class is as easy as this:
......

From here:
http://www.devx.com/java/Article/10471/1763/page/3

3.Re:能否在java类运行时,给该类加一函数或属性? [Re: feiggle] Copy to clipboard
Posted by: arthas1982
Posted on: 2005-07-15 11:04

这应该属于AOP的范畴把,IBM有一系列的文章,推荐你看看,《Java 编程的动态性》。

4.Re:能否在java类运行时,给该类加一函数或属性? [Re: feiggle] Copy to clipboard
Posted by: arthas1982
Posted on: 2005-07-15 11:05

By the way,WOW means "World of Warcraft"?hehe.

5.Re:能否在java类运行时,给该类加一函数或属性? [Re: arthas1982] Copy to clipboard
Posted by: ranchgirl
Posted on: 2005-07-15 13:44

arthas1982 wrote:
By the way,WOW means "World of Warcraft"?hehe.

Hey, arthas1982
You must be a game player/maker. I was a game maker, attended a game conference last year, and met game makers from all over the world. That was fun!

However, I'm working in a totally different industry now.
Good luck!

---GongShi

6.Re:能否在java类运行时,给该类加一函数或属性? [Re: feiggle] Copy to clipboard
Posted by: arthas1982
Posted on: 2005-07-18 19:39

Hey,gongshi
很高兴看到你的回复,I'm just a game player,but I will be a developer for ever!我没有大哥你丰富的工作经验,我才毕业一年。前几天因为工作不顺心,索性辞职在家玩《World of Warcraft》(伟大的游戏,伟大的Blizzard,当我看到Blizzard招熟悉Struts,hibernate的Web程序员时我还真的想去阿,可是他们只要北美地区的),现在我已经和毕博签了工作协议,在过一周我又要开始努力奋斗了。
I love game as i love Java.If i have a chance that meet game makers from all over the world,hehe,i will blast!
再者,如果你对Java有自己很成熟的想法,不妨在JSR里提出,或许还可以成为新规范的专家组成员呢,就像孙宾(令我尊敬的)先生一样。
Good luck!
-----Arthas1982

7.Re:能否在java类运行时,给该类加一函数或属性? [Re: feiggle] Copy to clipboard
Posted by: ranchgirl
Posted on: 2005-07-19 00:13

Dear arthas1982 :

Very happy to see your post!!! Smile Big Smile

1) I like your passion on game development! Knowing how to programming is not enough to be a good game developer, passion is absolutely required to be a great game developer. Many people, past me included, do not/did not realize that. You need to have the creative passion like film maker, novel writer, great painter, great artist, etc. to be a good game developer.

2) Be prepared, game developers are usually over-worked and under-paid. However, since they just love the job, have the passion, they will still do it, and do it forever like what you said.

3) Excellent game developers are also great artists, mathematicians, physicists, war strategists, experts on AI, ..., as well as good developer, you have a lot to learn for sure... Don't be scared, your passion will lead you through the learning process.

4) Hehe. You don't need all above to be a just-so-so game developer.

5) Actually, I have all others above, (no, hehe, not really Wink ), but lack of passion, which was why I changed my working industry. The passion is build-in, not something which you want to have, then you will have. Sad

6) From this passion sense, you are way better than me!!!

Good luck on your game business!!!

---GongShi


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923