DTO: Hipster or Deprecated?

Data Transfer Objects, known affectionately as DTOs, is the subject of a lot of discussions when we talk about the development of Java applications. DTOs were born in the Java world in EJB 2 for two purposes. 

First, to circumvent the EJB serialization problem; second, they implicitly define an assembly phase where all data that will be used for presentation is marshaled before actually going to the presentation layer. Since the EJB is no longer used on a large scale, can DTOs also be discarded? The purpose of this article is to talk a little bit about the usefulness of DTO and address this question.

Two Data Points the VP of Engineering Should Show the CEO Every Week

“Are we on track to deliver XYZ feature by the deadline?” 

For software development leaders, this is the question we get most. We get it from the CEO. We get it from the other VPs. We get it over Slack from the PMs and SREs. We get it from our technical support leads as we pass them in the hallway. We get it by text message early in the morning from a sales rep who is on-site with a big prospect. 

Integrating With SaaS Applications – Example 3rd-Party Platform Integration

Integrating SAAS application workflow
The previous article in this series looked at a SaaS CRM connector integration example. The foundation for this logical diagram was researching a use case where customers were successful with a portfolio solution.

It's a starting point for the generic architectural blueprint that rises from several customer solutions that were researched. Having completed the outline of the blueprint details and the resulting logical diagram elements, it's now time to take a look as specific examples.

In this article, we'll continue building the previous examples by sharing how customers are integrating with third-party platforms in their architectures as SaaS platforms.

Architectures for Distributed, Hybrid, Edge, and Global Apache Kafka

Multi-cluster and cross-data center deployments of Apache Kafka have become the norm rather than an exception. Learn about several scenarios that may require multi-cluster solutions and see real-world examples with their specific requirements and trade-offs, including disaster recovery, aggregation for analytics, cloud migration, mission-critical stretched deployments and global Kafka.

Key Takeaways for Multi Data Center Kafka Architectures

  • In many scenarios, one Kafka cluster is not enough. Understand different architectures and alternatives for multi-cluster deployments.
  • Zero data loss and high availability are two key requirements. Understand how to realize this, including trade-offs.
  • Learn about features and limitations of Kafka for multi-cluster deployments- Global Kafka and mission-critical multi-cluster deployments with zero data loss and high availability became the normal, not an exception.
  • Learn about architectures like stretched cluster, hybrid integration and fully-managed serverless Kafka in the cloud (using Confluent Cloud), and tools like MirrorMaker 2, Confluent Replicator, Multi-Region Clusters (MRP), Global Kafka, and more.

Slide Deck

 

Considerations for Creating a Card Component

Here's a Card component in React:

const Card = props => {
  return(
    <div className="card">
      <h2>{props.title}</h2>
      <p>{props.content}</p>
    </div>
  )
}

It might be pretty useful! If you end up using this thing hundreds of times, now you have the ability to refactor a little bit of HTML across your app very easily. You already have that power in CSS because of the class name there, but now you have HTML control too. Feel it.

But wait. Maybe this is limiting... an <h2>? What if that really should have been an <h4> in some usages? What's the approach there? Maybe an API of sorts?

const Card = props => {
  return(
    <div className="card">
      {props.type === "big" && <h2>{props.title}</h2>}
      {props.type !== "big" && <h4>{props.title}</h4>}
      <p>{props.content}</p>
    </div>
  )
}

Or maybe we force a level to be passed in?

const Card = props => {
  const HeaderTag = `h${props.level}`;
  return(
    <div className="card">
      <HeaderTag>{props.title}</HeaderTag>
      <p>{props.content}</p>
    </div>
  )
}

Or maybe that header is its own component?

And a forced paragraph tag wrapper around that content? That's a little limiting, isn't it? Maybe that should be a <div> so that it could take arbitrary HTML inside it, like multiple paragraphs.

const Card = props => {
  return(
    <div className="card">
      <WhateverHeader>{props.title}</WhateverHeader>
      <div>{props.content}</div>
    </div>
  )
}

Actually, why even ask for content with props? It's probably easier to deal with a child component, especially if what is coming over is HTML.

const Card = props => {
  return(
    <div className="card">
      <WhateverHeader>{props.title}</WhateverHeader>
      {children}
    </div>
  )
}

There are more assumptions we could challenge too. Like card only for a class name... shouldn't that be more flexible?

const Card = props => {
  const classes = `card ${props.className}`;
  return(
    <div className={classes}>
      <WhateverHeader>{props.title}</WhateverHeader>
      {children}
    </div>
  )
}

I'm still forcing card there. We could drop that so that it isn't assumed, or build another aspect of the Card API providing a way to opt-out of it.

Even the <div> wrapper is presumptuous. Perhaps that tag name could be passed in so that you could make it into a <section> or <article> or whatever you want.

Maybe it's better to assume nothing actually, making our card like this:

const Card = () => {
  return(
    <>
      {children}
    </>
  )
}

That way anything you want to change, you have the freedom to change. At least then it's flexibility while being relaxed about it, rather than this kind of "flexibility":

<Card
  parentTag="article"
  headerLevel="3"
  headerTitle="My Card"
  contentWrapper="div"
  cardVariation="extra-large"
  contentContent=""
  this=""
  little=""
  piggy=""
  went=""
  to=""
  market=""
/>

That kind of extreme-API-zying just happens sometimes when you're grasping for control and flexibility at the same time.

A component model with no guidance can lead to over-componentization also, like perhaps:

const Card = props => {
  return(
    <CardWrapperTheme>
      <CardWrapper>
        <CardTitle />
        <CardContent />
        <CardFooter />
      </CardWrapper>
    </CardWrapperTheme>
  )
}

There might be perfectly good reasons to do that, or it might be the result of componentizing because it's "free" and just feels like that's how things are done in an architecture that supports it.

There is a balance. If a component is too strict, it runs the risk of that people won't use them because they don't give them what they need. And if they're too loose, people might not use them because they don't provide any value, and, even if they did use them, they don't offer any cohesiveness.

I don't have any answers here, I just find it fascinating.

The post Considerations for Creating a Card Component appeared first on CSS-Tricks.

Integrating With SaaS Applications — Common Architectural Elements

Integrated SAAS application architecture

The introduction to integrating with SaaS applicationslaid the groundwork for a deeper exploration of its logical diagram. In this article, we continue with a look at the common architectural elements. A description is provided to guide you with aligning what we've presented here with the landscape your organization works with every day.

These details should help you understand both what the elements contain and how they might align and how their functionalities are grouped.

Let's look at the foundation of our integration with SaaS applications blueprint, the logical diagram with its architectural elements.

Integrating With SaaS Applications — An Introduction

Kubernetes service balancerSince introducing the first architecture blueprint focused on omnichannel integration, we've been looking at how to integrate with Software as a Service (SaaS) applications.

It's an interesting challenge in that we've been given the mission of creating architectural content based on common customer adoption patterns. That's very different from most of the traditional marketing activities usually associated with generating content for the sole purpose of positioning products for solutions. When you're basing the content on actual execution in solution delivery, you're cutting out the chaff. What's that mean?   

It means that it's going to provide you with a way to implement a solution using open source technologies by focusing on the integrations, structures, and interactions that actually have been proven to work. What's not included are any vendor promises that you'll find in normal marketing content. Those promised that when it gets down to implementation crunch time, might not fully deliver on their promises.

Enter the term Architectural Blueprint.  

This Page is Designed to Last

Jeff Huang, while going through his collection of bookmarks, sadly finds a lot of old pages gone from the internet. Bit rot. It's pretty bad. Most of what gets published on the web disappears. Thankfully, the Internet Archive gets a lot of it. Jeff has seven things that he thinks will help make a page last.

1) Return to vanilla HTML/CSS
2) Don't minimize that HTML
3) Prefer one page over several
4) End all forms of hotlinking
5) Stick with the 13 web safe fonts +2
6) Obsessively compress your images
7) Eliminate the broken URL risk

I don't take issue with any of that advice in general, but to me, they don't all feel like things that have much to do with whether a site will last or not. Of them, #4 seems like the biggest deal, and #5 is... strange. (Fonts fall back on the web; what fonts you use should have no bearing on a site's ability to last.)

I sort of agree with #1 and #2, but not on the surface. Both of them imply a build process. Build processes get old, they stop working, and they become a brick of technical debt. I still love them and can't imagine day-to-day work without them, but they are things that stands in the way of people wanting to deal with an old site. Highly relevant: Simplicity, from Bastian Allgeier.

Everything listed is technological. If we're talking technological advice to keeping a site online for the long haul, I'd say jamstack is the obvious answer. Prerender everything into static files. Rely on no third-party stuff anything, except a host. (Disclosure: Netlify is a current sponsor of this site, but I'm tellin' ya, toss a simple static site without a complex build process up on Netlify, which has a generous free tier, and that site will absolutely be there for the long haul. )

Don't diddle with your URLs either. Gosh darn it if I don't see a lot of 404s because someone up and changed up all their URLs.

But I feel there is something beyond the technological that is the real trick to a site that lasts: you need to have some stake in the game. You don't let your URLs die because you don't want them to. They matter to you. You'll tend to them if you have to. They benefit you in some way, so you're incentivized to keep them around. That's what makes a page last.

Direct Link to ArticlePermalink

The post This Page is Designed to Last appeared first on CSS-Tricks.

How to Modernize Your IT?

To have modern IT is to have an IT that uses modern technologies, components, and architectures. This search for modernity must be carried out within a thoughtful framework, taking into account the expected return on investment, the constraints of obsolescence, and the need for business differentiation. Indeed, what is the point of modernizing an application that is little used and has little business value?

You may also like: Introduction to Integration Patterns

HTTP and Scalable Software Systems

If you think about the World Wide Web, it's easy to imagine it as a single software system. Once you do, you realize it's the largest software system the world has ever created — probably by hundreds of orders of magnitude. It contains trillions of lines of code, hundreds of millions of servers, and billions of clients, running thousands of different programming languages. Still, it works more or less as we expect it to work. So, what made it possible for humans to create such an enormous software system? The answer is simple: HTTP!

The HTTP protocol allows us to create perfect encapsulation. The client and the server don't need to know anything about each other, besides the URL, HTTP verb, and what parameters to pass in and expect as output. This allows billions of clients to interact with each other, without knowing (almost) anything about each other. If you reduce it down to its basic components, it becomes painfully obvious that the following is a recipe for winning.

Domain-Driven Design With React

There is very little guidance on how to organize front-end applications in the world of React. (Just move files around until it “feels right,” lol). The truth is that we can do better. Let’s take a look at one pattern you might consider using to architect your site.

At first, you might split up your code between /components and /containers folders. This works for small sites but you’ll find yourself look for something more robust when scaling to larger sites. Luckily, decades of research into systems design has given us a wealth of patterns to explore to create a scalable architecture.

One of those is domain-driven design, and it has regained popularity over the last few years. Let’s explore how we can use it in React-land.

A primer on domain-driven design

Domain-driven design (DDD) is the practice of managing complexity of software applications by relating their underlying data models to domain logic. That’s a mouthful, so let’s break it down further.

The domain is an ontology, meaning how things are grouped in the world. For example, the word joist has a very specific connection to the domain of building construction. Another word, like Mike, can belong to multiple domains, such as the domain of Biblical names (short for Michael), or in the domain of politics as it relates to the NATO phonetic alphabet.

When the design is domain-driven, it means we place the model of our domain (e.g. a playing card in the domain of Poker) in a context (e.g. the contextual grouping, such as a Game) to help manage the complexity.

Organizing a DDD site

Domain-driven design is specifically for handling the complexity of growing sites as they add more and more models. It doesn’t really make sense for a site with one model. Once you get to about four models, that’s a good time to start looking at binding your models to multiple contexts. This isn’t a hard-and-fast rule, so don’t feel like you have to break out into multiple contexts, but once you get above four models, those contextual groupings will begin to surface.

Start by organizing your domains

Let’s use Twitter as our example site to organize. One way to separate domains within Twitter is to split up our models between the Blog platform that powers the Tweets and the Interaction elements that enable the micro-blogging to spread and flourish.

Is this the only way to separate concerns in Twitter? Definitely not! One key aspect of DDD is that there is no one correct way to create domains. There are plenty of ways to split up the bounded contexts of an application, so don’t focus too much on the architecture we’ve chosen. Instead, use this as a springboard to understand how we can apply DDD to the organization of our front-end code.

That said, our code will now be structured to look like this (assuming you start with something like create-react-app):

twitter/
├── App.css
├── App.js
├── App.test.js
├── blog/
└── interaction/

Define the components and containers in each domain

Now that we have our basic folder structure set up, it is time to add some real components! Looking at our domain UML diagram above, it would be useful to start with containers that fetch data on a given page and components that organize the templates that compose those pages. Expanding on our app, we now have the following structure in place (omitting our accompanying test.js files for simplicity):

twitter/
├── App.css
├── App.js
├── App.test.js
├── blog/
│   ├── HomePage.js
│   ├── TweetCard.js
│   ├── TweetDialog.js
│   ├── TweetList.js
│   ├── TweetListItem.js
│   ├── UserPage.js
│   └── UserCard.js
└── interaction/
    ├── FollowButton.js
    ├── LikeButton.js
    └── ShareButton.js

We still keep our App file to initialize React to our root-level HTML tag. With our domains in place, we begin to build our containers (such as HomePage and UserPage) and components (such as TweetCard and TweetListItem). Alternatively, we could further segment the models within our domains to look like so:

twitter/
└── blog/
    ├── user/
    │   ├── HomePage.js
    │   ├── UserCard.js
    │   └── UserPage.js
    └── tweet/
        ├── TweetCard.js
        ├── TweetDialog.js
        ├── TweetList.js
        └── TweetListItem.js

But given the size of the application it isn’t necessary at this stage.

Add helpers, if they’re needed

As we build out our application our UIs will continue to increase in complexity. To deal with this, we have two methods for separating concerns and pulling logic out of our component templates: presenters and utilities. Presenters push all of the visual presentation logic out of the templates to keep the view layer as clean and simple as possible. Utilities collect shared functionality for all other logic on the front end that is not specifically related to the templates. Let’s examine these a bit closer.

Clean up templates with presenters

Think of a Twitter profile. What kinds of elements do you see here on my account?

There’s information directly related to my user: name, handle, description, location, website, birthday, start date. There are also counts of associations between other models — how many other users are following me? How many other users am I following? There’s additional logic that isn’t even captured on the page, such as my tweets, replies, media uploads, and content I’ve liked. To capture all of this presentational logic appropriately, we can add an additional file within our file tree to isolate our presenter pattern from the JSX component:

twitter/
└── blog/
    ├── user/
    │   ├── UserCard.js
    │   ├── UserCard.presenter.js

Push out logic into utilities

Certain presentational logic is so fundamental that it could be useful across applications regardless of whether or not it is used within rendering. Currency formatting, validations, and timestamp formatting are all use cases where we could benefit from isolated utility functions across our application. Where do those live? Since they span domains, utilities can be in their own folder:

    twitter/
    ├── App.css
    ├── App.js
    ├── App.test.js
    ├── blog/
    │   ├── HomePage.js
    │   ├── TweetCard.js
    │   ├── TweetDialog.js
    │   ├── TweetList.js
    │   ├── TweetListItem.js
    │   ├── UserCard.js
    │   ├── UserCard.presenterjs
    │   └── UserPage.js
    ├── interaction/
    │   ├── FollowButton.js
    │   ├── LikeButton.js
    │   └── ShareButton.js
    └── utils/
         ├── currency.js
         ├── time.js
         └── validation.js

There is no wrong way to organize your app!

Ultimately, the choice is yours. This is just one example for myriad ways you could arrange your application. Domain-driven design is a valuable tool because it separates business logic in a meaningful way, creates a clearer distinction for domain expertise amongst developers, and provides rules for easily organizing and scaling your code.

But if you’re looking for an alternative to the traditional chaos of React application file structures, take a look at domain-driven design. It may be just the thing.

Lastly, if you like this sort of content and want to learn more about front-end, user interface development, and UX design and research (organized by your experience in the industry), I run a free newsletter that you might want to check out.

The post Domain-Driven Design With React appeared first on CSS-Tricks.

CSS Architecture for Modern JavaScript Applications

There is a lot to like from Mike Riethmuller here:

  • The title. When you're building a website from JavaScript-powered components anyway, that is a moment to talk about how to do styling, because it opens some doors to JavaScript-powered styles that you probably wouldn't otherwise choose.
  • The personal experience and pragmatism. Drawing on five years of consulting, he's seeing that component re-use and style understandability is suffering, not improving, partly due to every team having different approaches. He says "it's a little bit of everybody's fault" and sees the perspective of others who like parts of what JavaScript-powered styles can bring, like less dependence on specificity.
  • The fresh thinking. Since JavaScript-powered websites are all built by nested components anyway, why not use that architecture for styling? The thesis of the article is really about building UI components that, on purpose, don't involve application logic but exist just for styling, and using a combination of clever CSS and JavaScript power to the kind of styling you need.

Direct Link to ArticlePermalink

The post CSS Architecture for Modern JavaScript Applications appeared first on CSS-Tricks.

How Zero Trust Architecture Keeps Your Data Safe

Just as every rose has approximately 23.5 thorns, every business innovation gives rise to an array of cybercrimes designed to exploit it. As we become a more connected world — sharing data and processes, sending live communications over mountains and oceans, and logging on to apps hosted across any number of nations — nefarious threats rise to meet our best intentions.

It's no wonder Cybersecurity Ventures predicts that, by 2021, businesses will fall victim to a ransomware attack every 11 seconds.

Parallel Builds and Modularity for Faster Releases

Together, we can release faster.

Leading software development companies are now deploying software multiple times per day. In this sort of environment, even small periods of waiting can add up to significant disruptions. One of the bottlenecks we have heard from our customers lately is with their builds. If you are deploying your software multiple times per day, you are a building your software multiple times per day, the faster you build, the faster you can deploy your software. We recently reduced one of our clients build times by almost 70% using parallel builds and modularity, which allowed them to release their software faster.

You may also enjoy:  Patterns of Modular Architecture (RefCard)

How Do Parallel Builds Work?

Many popular tools support parallel builds including JFrog’s Conan, Maven, Gradle, and MSBuild. This allows you to utilize the full power of your hardware. Parallel builds analyses your project's dependencies and builds the modules in parallel based on the inter-module dependencies. According to Maven, your build performance can improve 20-50% by implementing parallel builds, but performance depends greatly on your software architecture (or how modular your software is). Below is an example representation of a software application’s dependencies. Each letter in the graph represents a module in the code.

Line of Business Skeleton for Xamarin App, Part 1: A Brick in the Wall


Hello developers and software designers. I'm writing this article to open a discussion about the idea of developing a skeleton for Xamarin applications with pluggable components and services. I've finished writing a technical document after we — as a team — finished delivering a line-of-business mobile application to oen of our clients. We planned from the beginning to shape a skeleton inside this project that can help us later with the next projects. Let's share it with you.

This is a technical article that demonstrates the architecture and designs used to implement the desired features. I tried to illustrate each piece of code, designs, thoughts, and decisions visually with diagrams.

Five Questions Everyone Is Asking About Microservices (Part 5)

How would an API gateway or service mesh be used to migrate an application to a more modern way of working? 


When discussing the development impact on existing applications while transitioning to microservices, there are five questions that keep popping up in one form or another. They are the same regardless of the size of the organization and seem to become part of strategy discussions later in the process as organizations move towards microservice architectures.

Five Questions Everyone Is Asking About Microservices (Part 4)

When discussing the development impact on existing applications while transitioning to microservices, there are five questions that keep popping up in one form or another. They are the same regardless of the size of the organization and seem to become part of strategy discussions later in the process as organizations move towards microservice architectures.

These articles cover questions that everyone should ask about microservices. They're based on experiences from interactions with organizations in the process of conquering microservices for existing development and for delivering modern applications.