RSS

Tag Archives: JEE

Here be dragons

Entry 7, Day 11

It seems that I’m more of a writer than a coder in this little endeavour. Well, old habits die hard, I wrote quite a lot of stuff several years ago, although not really technical. Anyway, this is good. Before you sit to code in the new projects, there are some stuff, you need to discuss with other devs, the Product Owner, Stakeholders/Clients, right? (Yes, devs can talk to Stakeholders directly, even though the PO is their default world interface. It can be very beneficial to the project). So now, let’s wander into the unknown lands of dragons. The enterprise (and less enterprise) technologies. There will be a lot of links.

Usually, there is a number of so called “technologies”, you will want to use. Theoretically, you can write an application using almost pure Java on top of application server (or what the hell, even without the server, just play with sockets manually), but it is impractical to say the least.

Under normal circumstances, the technology choice depends on what you want to achieve, what are the skills in the team at your disposals or other external factors like deals with big nasty software corporations. Since I’m my own client, I’m free to do what I please. I will go for some healthy mix of things that are suitable, fun, that I want to learn, and that I already know, and want to know better. Using only unknown technologies might be more beneficial from the learning point of view, but being struck at every aspect of the application might not be funny (not that I’m a pessimist, but I’ve seen stuff…). So I need some fields, where I know I can go fast to repair my ego if needed.

So, the main technology I will use is Java 8 language, as I’ve mentioned in the previous post.

Of course, since we are talking web application, the backbone of everything is HTML, this is what the user receives at the end.

There must be some kind of presentation technology (unless you are writing some purely backend EDI system or something similar). If you are truly old school, you can go with JSP pages. A bit more modern approach would be JSF or Velocity. There are plenty fish in the sea.

Client likes the application to be responsive. So instead of reloading the entire page, you can do things in the browser, instead of on the server. We can go with JavaScript, Dart, or my favourite: GWT. Actually GWT will do the job with both static and dynamic web content, and it is a Java compiled to JavaScript. I’m a big fan.

Then there is (usually) the framework that simplifies things (or complicates, depending on the framework and usage). Spring is the choice here, since it’s tremendous popularity in recent times. I’ve used it quite a bit, but there is still much to learn for me.

There is an object-relational mapping framework, Hibernate being popular choice.

Those are the core technologies. There will probably be many more, but we are not doing Big Design Up Front, remember? I will add and comment on new stuff as needed.

By the way, I think the word technology is sometimes an overkill when it comes to software. Nuclear bomb is a technology. Internal combustion engine is a technology. Microprocessor is a technology. Although Wikipedia says that technology is “collection of tools, including machinery, modifications, arrangements and procedures used by humans”, it seems to me that a piece of software written by a guy over several evenings while drinking beer shouldn’t be called that. Not that I don’t respect contribution to mankind well being, but there is a matter of scale. Probably “library” is sometimes a better word than “technology”.

dragons

 

 
Leave a comment

Posted by on August 12, 2014 in BookSentry, Technology

 

Tags: , , ,

The Matrix

Entry 5, Day 8

The first matrix I designed was quite naturally perfect. It was a work of art. Flawless. Sublime. A triumph only equaled by its monumental failure.

– The Architect

Software Architecture is the high level structure of a software system. Now I’m smart, I have Wikipedia.

Sometimes, if you ask a developer what is the architecture of the system he is working on, he would say something like, “Well, we have a JSP view, we use EJB to figure things out, Hibernate to persist and everything sits on top of Weblogic server”. Actually, this is not an architecture description, this is a list of technologies used to create the system (or, if you need a fancy term: the technology stack). Of course, there is a slight hint, that we are dealing with a client – server application with at least three layers.

Architecture might be client – server, peer to peer, event driven, rule based, plug-in based or other. Or the combination of them.

As I said before, I’m aiming for agile, emergent design. It does not imply, that I don’t have some kind of vision of what I want to write. I will probably go with client – server, multi tier application. What does this mean? We know more or less, what is 3 – tier architecture: we have a Presentation layer, Business Logic layer and Data layer. So where is the fourth and fifth or any further layers? Well, you may divide those layers further. Let’s take a look.

Presentation is well… presentation. But if you go beyond simple CRUD, it might turn out, that you need some kind of logic just for managing presentation (fancy drag n drop and dynamic stuff support for example), not really business logic layer, but layer separate from static HTML inputs. So, you may split this into two.

Business Logic might have controllers, which glues together front end and back end. And then, they might have EJBs or Spring Services, which performs actual computations or choices having data and given user input. Or other input for that matter, say JMS messages or WebServices calls from foreign systems. Also, you may split service in as many layers as you need depending on the case. Some systems might be very sophisticated, and saying that there is just one business logic layer would not be an understatement.

Data layer may consists of Data Access Objects, which gives you data in the form of cute little Java objects magically drawn from the database. Then there is the magical Object Relational Mapping Framework at work, preparing and running queries in SQL native to the database, transparently for the user. Database is the, more or less, final layer, and besides table definition it may consists of triggers, scheduled jobs (for partitioned tables periodic cleanup, for example) and some other nasty things. Perhaps there are also other layers in the database department, but well… I’m more like in the Java department, so I won’t dig deep here.

Some developers shun the idea of doing any logic outside of Java code (I’m not talking about external libraries, but I will later). I was such developer once. But I’ve figured out, that some things may be better done outside of Java, even though I cannot put a breakpoint there. I’d love to think about them as Java minions who do some magic yet inferior things, but as long as they do it well, I have no objections. Otherwise I will have to frown my eyebrows, get out of coziness of my beloved Eclipse and step in to figure out why SQL or ant script is behaving badly.

 

vsbigone

 

 
Leave a comment

Posted by on August 9, 2014 in BookSentry, Clean Code, Technology

 

Tags: , , ,