Stijn Janssens

Greenhorn
+ Follow
since Sep 09, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Stijn Janssens

Bear Bibeault wrote:Or, are you actually trying to figure out how to write exclusively client-side apps give a remote RESTful API?



Exactly, I am just trying to understand what the best practices are for structuring client-side apps that have dynamic content based on data retrieved from RESTful APIs...
I am aware of alternative approaches (like JSP, PHP, rails, ...) but I'm just interested in a HTML5-Javascript only approach so I was wondering if you should use web sockets for this or AJAX or ???


Thanks!!
I am a back-end developer, been using JEE (web services, ESBs, JEE, ...) for ages but just started playing around with HTML 5, CSS 3 and Javascript....
Could someone give me some inside into best practices for architecting html5-javascript web apps.... What's the best high-level architecture?
Say you want to implement a blog but you don't want to go the Wordpress route... You create a DB and offer some Rest services and then you write your index.html file with the general content (header, body, footer, ...). Now, how do you retrieve the blog articles? Do you use javascript web sockets when the page loads and update the DOM accordingly, adding the HTML code through Javascript at runtime? Or do you use AJAX for that? Or is there some other data binding technique?

Thanks Henri,

I modified my code and now it works

I want to parse a String using reg ex.

This is my code:



I want an array of all the strings between [ and ] (so {"dfdsfdf","dsfsdfs", "sdfsdfsdf", "sdf546456", "17/06/1966", ...}).

But I get:


Anyone who knows the answer?

Originally posted by Kumar kum:
Congrats !!!

If you don't mind could you share your experience I mean how do you prepare,how much time you took,books,regarding SCJP exam and I am happy to hear many more from you.


Regards,
Kumar.


I wrote a post about my certification here. I spend 2 weeks of studying, 4 hours a day.

Stijn
16 years ago
Thanks!
I see you've done the "IBM SOA Associate (Test 664)". Can you give me some adive on it? How long did you study? What study material did you use?

Thanks
16 years ago
Hey, just wanted to mention that i passed the SCJP 6 exam with 84% after 2 weeks of studying...

Cheers
16 years ago
Access modifiers are keywords used to specify the declared accessibility of a member or a type. There are three access modifiers in Java: coderanch, protected and private. However, there are four access controls (levels of access), the fourth being default or package level access (no modifier added). A class can only use public or default, while most methods and variables take all four.

Nonaccess modifiers modify the declaration of a member or a type. They can be used in addition to whatever access control there is on a class.
A class declaration can be modified with keywords final, abstract, or strictfp (note: you can't always mix nonaccess modifiers).
Methods and instance variables can also take transient, synchronized, native, strictfp, and static as modifiers.
Check faq.javaranch.com for the difference between SCJP 5 & 6.

I've also written some tips on Java certification here
Hey Ronald,
You are correct but since the code was printed without the class, I assume they didn't count the " ", which is loaded when the class is loaded. They are basically just asking how much objects are created in:

Anyway, I think this is pretty clear now...
I would guess there are 11 String objects created:

Compile time
�spring � // line 1
�summer � // line 2
�fall � // line 3
�winter � // line 5
� � // line 6

Runtime
�spring summer� // line 2
�spring fall � // line 3
�spring summer spring � // line 4
�spring winter � // line 5
�spring winter � // line 6
�spring winter spring summer� // line 6

From those 11 objects, only 3 are ever referenced by variables (�spring �, �spring summer� and �spring winter �). And when this code finishes, only 2 are still referenced by variables (�spring summer� and �spring winter �).

Say the compiler optimizes the String concatenations. �To increase the performance of repeated string concatenation, a Java compiler may use the StringBuffer class or a similar technique to reduce the number of intermediate String objects that are created by evaluation of an expression.�
This might result in something like this:



Then the following String objects would be created:
Compile time
�spring � // line 1
�summer � // line 2
�fall � // line 3
�winter � // line 5
� � // line 6

Runtime
�spring summer� // line 2
�spring fall � // line 3
�spring summer spring � // line 4
�spring winter � // line 5
�spring winter spring summer� // line 6

This still results in 10 String objects. It doesn�t matter if they are discarded right away since the question was how many String objects are created.

Now, concerning the K&B book, the question was: how many String objects and how many reference variables are created prior to the println statement. This is then: 2 reference variables (s1 & s2) and 8 objects (�spring �,�summer �,�fall �,�winter �,�spring summer�, �spring fall �,�spring summer spring � and �spring winter �).
Static methods or variables are never accessible with this since this refers to the instance and statics don't belong to an instance. You access a static member by using the . operator on the class name.

Strangely, it is also possible to use an object reference variable to access a static member but this is more a syntax trick since you're using the object reference variale to access the static and not the object itself.